daattali / shinycssloaders

⌛ Add loading animations to a Shiny output while it's recalculating
https://daattali.com/shiny/shinycssloaders-demo/
Other
395 stars 45 forks source link

Spinners not showing up for an output that was previously hidden but now shown with conditionalPanel #35

Closed daattali closed 4 years ago

daattali commented 4 years ago

Sample code to reproduce the problem:

library(shiny)

ui <- fluidPage(
  checkboxInput("show", "show plot", TRUE),
  conditionalPanel("input.show",
                   plotOutput("plot") %>% shinycssloaders::withSpinner())
)

server <- function(input, output, session) {
  output$plot <- renderPlot({
    input$show
    Sys.sleep(1)
    plot(rnorm(100))
  })
}

shinyApp(ui, server)
daattali commented 4 years ago

Same buggy behaviour is seen if shinyjs::toggle()/show()/hide() is used

daattali commented 4 years ago

This has been fixed in the last few months