juba / shinyglide

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

Content gets squished when used in multiple tabPanels #6

Closed LeonhardBakker closed 4 years ago

LeonhardBakker commented 4 years ago

Hi!

Thank you for this package. I'd like to add this functionality to my Shiny apps. However, the content gets squished when I try to use glide in multiple tabPanels. I have added an example below. In this example the content is squished in the second tabPanel.

Regards, Leonhard

# libraries
library(shiny)
library(shinyglide)

# ui
ui <- shinyUI(
    navbarPage(
        title = "Old Faithful Geyser Data",
        tabPanel(
            title = "tab1",
            glide(
                screen(
                    sliderInput(
                        "bins",
                        "Number of bins:",
                        min = 1,
                        max = 50,
                        value = 30
                    )
                ),
                screen(
                    plotOutput("distPlot")
                )
            )
        ),
        tabPanel(
            title = "tab2",
            glide(
                screen(
                    tags$h3("second tab"),
                    tags$p("first screen")
                ),
                screen(
                    tags$h3("second tab"),
                    tags$p("second screen")
                )
            )
        )
    )
)

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

    output$distPlot <- renderPlot({

        x    <- faithful[, 2]
        bins <- seq(min(x), max(x), length.out = input$bins + 1)

        hist(x, breaks = bins, col = 'darkgray', border = 'white')
    })
}

# run
shinyApp(ui = ui, server = server)
juba commented 4 years ago

Yes, you're right.

I think this should be fixed now in the development version. Feel free to reopen the issue if the problem still occurs.

Thanks for taking the time to report the issue.