juba / shinyglide

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

Container resize does not resize contents #10

Closed dahef34 closed 4 years ago

dahef34 commented 4 years ago

I'm sorry I don't have an easy reprex, but I think I can describe it well enough. I have a glide that works as expected except when the container is resized. I'm using shinydashboard and if the sidebar is opened or closed the screen contents maintain their original size instead of scaling with the box container. This ends up showing multiple screen contents on the same page. If the browser is resized, the contents will resize in that situation and the issue resolves.

juba commented 4 years ago

Thanks for taking the time to report the problem. Unfortunately it would be much simpler for me to look at it with a reprex, as I fear I won't be able to find the time to build one in the days to come.

ghost commented 4 years ago

Since I believe I'm having the same or a related issue, here's an example:

library(shiny)
library(shinyglide)
library(shinydashboard)

header <- dashboardHeader()
sidebar <- dashboardSidebar(sidebarMenu(menuItem("Tab name", tabName = "Tab_name")))

body <- dashboardBody(
  tabItems(
    tabItem(tabName = 'Tab_name',
            glide(
              screen(
                h2("Long line of text")),
              screen(
                h2("Long line of text"))
            )
    )
  )
)

ui <- dashboardPage(header, sidebar, body)
server <- function(input, output, session) {}
shinyApp(ui, server)

Screen Shot 2020-05-09 at 9 25 09 PM

I'm pretty sure it's related to using shinyglide and shinydashboard together? Or at least the simple examples I've tried work fine without shinydashboard.

ghost commented 4 years ago

Never mind. I just saw issue #6 and tried that. It looks like this issue (or at least my issue) is solved by using remotes::install_github("juba/shinyglide"). Thanks! :)

juba commented 4 years ago

Thanks for letting me know it seems fixed in the dev version !

Closing this issue for now...