Closed vhorvath closed 1 year ago
Sorry for the very slow reply -- could you please share a minimal code example? I'm not sure if this is a bug or a correct behaviour from shiny, because reading the docs for the javascript events seems to suggest that recalculating
should follow outputinvalidated
. With a complete example I'd like to see what's happening and if the JS events are firing correctlly, because I'm not sure why in such a specific case an event isn't fired
Closing due to no reprex
Today I ran into the following issue with
withSpinner()
.I have modal with tabs in it. When a tab is selected the content must be refreshed, which is a slow process. I wanted to use
withSpinner()
to wrap aDT::dataTableOutput()
.It took me quite a while to find out that this does not work, because the backend triggers an event that the spinner is not receptive to, here is the message log:
Spinner listens to
shiny:outputinvalidated
, but that is never triggered, at least in Shiny 1.5.0, so it remains hidden.When I paused the
JS
execution in Chrome and manually added an identical listener toshiny:recalculating
it suddenly started working.Perhaps listening to this event in addition to the original one could be helpful for others as well. Very minor difference shown below.
If this makes sense, I can create a PR.
Also, if someone is interested in using this early, you can include the following file (extracted as
spinner-patch.js
) at the beginning of your Shiny app as part of the header somewhere.spinner-patch.zip