juba / shinyglide

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

Displaying shinyglide in modal issue #39

Closed analytichealth closed 1 year ago

analytichealth commented 1 year ago

Hi, when opening a modal containing a shinyglide it works fine the first time, but then not after that. You'll notice the buttons are not rendering or functioning correctly on the second time of clicking the action button. Thanks

Tried using CRAN 0.1.3 and dev version 0.1.3.9

library(shiny)
library(shinyglide)

ui <- fixedPage(style = "max-width: 500px;",
                titlePanel("Simple shinyglide app"),

                actionButton(inputId = 'show', label = 'show')
)

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

  output$plot <- renderPlot({
    hist(
      rnorm(input$n),
      main = paste("n =", input$n),
      xlab = ""
    )
  })

  observeEvent(input$show, ignoreInit = TRUE, {

    showModal(
      modalDialog(
        title = 'Glide', 
        fade = FALSE,
        glide(
          height = "350px",
          screen(
            p("This is a very simple shinyglide application."),
            p("Please click on Next to go to the next screen.")
          ),
          screen(
            p("Please choose a value."),
            numericInput("n", "n", value = 10, min = 10)
          ),
          screen(
            p("And here is the result."),
            plotOutput("plot")
          )
        )
      )
    )

  })

}
juba commented 1 year ago

Hi, and sorry for the very late answer...

I think the problem should now be fixed in the development version.

Thanks for taking the time to report the issue with a reproducible example.

analytichealth commented 1 year ago

That works, thanks for your help! There was a grab style cursor, I changed that with:

.glide--swipeable {
    cursor: default !important;
}