JohnCoene / waiter

🕰️ Loading screens for Shiny
https://waiter.john-coene.com/
Other
495 stars 25 forks source link

Waiter resize with toggle sidebar #122

Open LaFeh opened 2 years ago

LaFeh commented 2 years ago

I am using the waiter package in a shinyApp with shinydashboardPLUS. The waiter-overlay does react to"standard" resizing events but not to the toggle-sidebar event that comes with shinydashboardPLUS.

It would be create if the width of the waiter overlay changed when the sidebar is toggled. Does anyone know a quick fix?

Here is a repex:

library(shiny)
library(waiter)
library(shinydashboardPlus)

ui <- dashboardPage(header=dashboardHeader(),
                    sidebar=dashboardSidebar(),
                    body=dashboardBody(useWaiter(), # include dependencies
                                actionButton("show", "Show loading for 3 seconds"),
                                div(id="load","hello"))

)

server <- function(input, output, session){

    observeEvent(input$show, {

        waiter_show( id="load",# show the waiter
            html = spin_fading_circles() # use a spinner
        )

        Sys.sleep(3) # do something that takes time

        waiter_hide() # hide the waiter
    })

}

shinyApp(ui, server)
JohnCoene commented 2 years ago

@divadNojnarg do you fire an event when this is resized?