PaulC91 / shinyauthr

R package with shiny authentication modules
https://paulc91.github.io/shinyauthr/
Other
427 stars 81 forks source link

Issue adding a loading icon/spinner #40

Closed wadehobbs closed 3 years ago

wadehobbs commented 3 years ago

I have built an app using the following example as a template as it uses shinydashboard and hides content until a user has logged in. https://github.com/PaulC91/shinyauthr/blob/master/inst/shiny-examples/shinyauthr_example/app.R

I am having trouble showing a loading icon/spinner while plots are build built. For example, using the shinycssloaders package with the 'withSpinner()' function. This should be added as follows: plotOutput("myplot") %>% withSpinner().

However as I am using the uiOutput("testUI") function and renderUI() within the server, its unclear where the withSpinner() function should be added. Ive tried all the options i can think of without any luck. It appears work for the whole page if i add it to the uiOutput("testUI) %>% withSpinner(), but the page is just blank while the plot is loading.

wadehobbs commented 3 years ago

Managed to get it working with shinybusy package, putting the 'add_busy_spinner()' function as follows: renderUI(fluid_page(add_busy_spinner(column(etc etc))). Thanks.