-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Bindings can't be registered asynchronously #3635
Comments
For posterity, with Shiny>1.7.4, one can workaround this issue by adding this right after registering the binding (as was done in posit-dev/py-shinywidgets#91) Shiny.shinyapp.taskQueue.enqueue(() => Shiny.bindAll(document.body)); |
Update: see version in posit-dev/py-shinywidgets#93 I think it can actually be simplified to: Shiny.shinyapp?.taskQueue?.enqueue(() => Shiny.bindAll(document.body)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider a basic input binding:
Now, if we register synchronously all is fine, but not if we register in a
setTimeout()
, the binding doesn't bind to the DOM:That use case may seem contrived, but becomes a real problem if you're trying to load JS dependencies asynchronously (e.g., via requirejs) to define/register the binding:
The text was updated successfully, but these errors were encountered: