juba / shinyglide

Glide.js component for Shiny apps
https://juba.github.io/shinyglide/
91 stars 8 forks source link

glide isn't properly resized when a vertical scrollbar appears #30

Closed ismirsehregal closed 2 years ago

ismirsehregal commented 2 years ago

Using shinyglide 0.1.3 (latest CRAN) the glide isn't properly resized when a vertical scrollbar appears.

Please see the following example and note the upper right part of the app (the right side of the upper wellPanel gets cut-off):

library(shiny)
library(shinyglide)
library(datasets)

ui <- fluidPage(
  titlePanel("Hello Shiny!"),
  sidebarLayout(
    sidebarPanel(
      radioButtons("test", "test", choices = c("show", "hide")),
      sliderInput("obs",
                  "Number of observations:",
                  min = 0,
                  max = 1000,
                  value = 500)
    ),
    mainPanel(
      glide(screen(wellPanel("First screen.")), screen(wellPanel("Second screen."))),
      p(),
      wellPanel("Another wellPanel."),
      conditionalPanel("input.test === 'show'",
                       tableOutput("iris_out"))
    )
  )
)

server <- function(input, output) {
  output$iris_out <- renderTable(iris)
}

shinyApp(ui, server)

Animation

juba commented 2 years ago

Indeed, window resize was handled but not parent element resize. I think this should now be fixed in the development version, but let me know if it is not the case.

Thanks for the detailed report.

ismirsehregal commented 2 years ago

@juba thanks for the swift update! It works fine now.