Closed nklepeis closed 3 years ago
Yes, the problem comes from the collapsible sidebar. When you close it, the width of the glide container is modified but the width of the glides themselves is not. If you resize the window, which forces a size recomputing, they should be displayed correctly again. I'm not sure there would be a way to force a resize when the sidebar is collapsed / displayed...
Thanks! I added the following to my Shiny server code and it seems to do the job. I detect the sidebar collapse event and fire a window resize javascript event using the shinyjs R package.
observe({
state <- input$sidebarCollapsed
# run the following to fire a resize of the window
# so the glide screens are resized...
# https://stackoverflow.com/questions/1818474/how-to-trigger-the-window-resize-event-in-javascript/18693617#18693617
runjs("window.dispatchEvent(new Event('resize'));")
})
As you may not be alone to encounter this issue, I added a specific listener to "sidebarCollapsed" which forces a glides resize. So I think this should now work correctly out-of-the box with the development version.
Thanks for taking the time to report the issue.
Hi, Awesome package! I'm making a dashboard for showing different health topics using shinydashboardplus. I'm having an issue with different shinyglide screens not being hidden properly when the sidebar is closed.
See my attached code (R shiny app) and screenshots that illustrate the problem.
Thanks for any insights! --Neil
This one shows the problem when the sidebar is closed
This one is the expected behavior when the sidebar is open:
Shiny code here:
` #
This is a Shiny web application. You can run the application by clicking
the 'Run App' button above.
#
Find out more about building applications with Shiny here:
#
http://shiny.rstudio.com/
#
library(shiny) library(shinydashboard) library(dashboardthemes) library(shinydashboardPlus) library(shinyWidgets) library(shinyglide)
ui <- dashboardPagePlus(
sidebar_fullCollapse=TRUE,
dashboardHeaderPlus(
), dashboardSidebar(
), dashboardBody(
) )
Define server logic required to draw a histogram
server <- function(input, output) {
}
Run the application
shinyApp(ui = ui, server = server) `