Open jcheng5 opened 8 months ago
For now, you can workaround this problem by statically rendering output_widget()
's HTML dependencies, for example:
app_ui = ui.page_fluid(
output_widget("foo").get_dependencies(),
ui.output_ui("dynamic_ui"),
ui.output_text("value")
)
I haven't looked deeply yet at what is causing this, but based on the fact that the simple dynamic UI usage works fine, it seems the issue derives from register_widget()
getting called before the output binding has been registered (i.e., before output_widget()
s dependencies have rendered).
PS. I'm not totally sure if it'll make sense for {shinywidgets}
to "just work" with this sort of usage. In the case that it doesn't, it feels like there should be a use_shinywidgets()
(which would a thin wrapper around output_widget("foo").get_dependencies()
)...
Description
With this app I was trying to have a widget returned from a UI output. But no widget appears, and there's a JS error saying "No model found for id {whatever}".
It looks to me like the fact that the widget registration happens before the
output_widget
is bound, is something shinywidgets didn't expect?