Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML elements with shiny input bindings don't work in waiter screens? #145

Open
TransGirlCodes opened this issue Nov 16, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@TransGirlCodes
Copy link

TransGirlCodes commented Nov 16, 2023

Hi, I thought of creating a custom widget for putting into loading screens for unavoidable loading times: provide a very lightweight game like 'snake' to give the user something to fidget with.

So that's what I did: I built a class for a simple snake engine in vanilla js, created the Shiny Input Binding for it (thought it would be cool to allow the possibility of passing scores and such to the R side in the future), and when I put it in the main page of the UI it works. But not when it's put in the HTML for the waiter screen (html argument for show_waiter.

I then experimented and stuck an actionButton in the waiter's html and hooked it up to a bindEvent to print to REPL on click, and that button also does not work. So do elements with input bindings not work in waiter screens? Is there a way around this?

Here's a link to my dummy rhino app with the widget. The app shows the working game element in the main page and has a button to trigger the waiter screen, which contains the non-working game element. https://github.com/TransGirlCodes/ShinySnakeTest

@JohnCoene JohnCoene self-assigned this Jan 27, 2024
@JohnCoene JohnCoene added the bug Something isn't working label Jan 27, 2024
@JohnCoene
Copy link
Owner

Hi @TransGirlCodes sincere apologies for the late response. I've been tied with work for quite some time and your issue totally escaped me, I'm really sorry!

I think I may eventually be able to fix this with.

  window.Shiny.renderDependenciesAsync(opts.content.deps).then(() => {
    window.Shiny.renderContentAsync($(`#${opts.id}`), opts.content.html).then(
      () => {
        // ...
      },
    );
  });

Coupled with

process_deps <- function(...) {
  utils::getFromNamespace("processDeps", "shiny")(...)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants