yonicd / slickR

slick carousel htmlwidget for R
https://yonicd.github.io/slickR/
Other
159 stars 14 forks source link

fix duplicate sliders #77

Closed yonicd closed 7 months ago

yonicd commented 10 months ago

closes https://github.com/yonicd/slickR/issues/70, https://github.com/yonicd/slickR/issues/76

yonicd commented 10 months ago

this does not create duplicate slides any longer in when rendering in shiny

library(shiny)
library(slickR)

ui <- fluidPage(

    mainPanel(

      slickROutput("slickr", width="100%"),

      actionButton("submit", "An action button")

    )

)

server <- function(input, output) {

 load_random_images <- function(x) {
    sample(slickR::nba_player_logo$uri,5)
 }

  output$slickr <- renderSlickR({
    input$submit

    slickR(load_random_images(), height = 400, width = "100%",
           padding = 0) + 
      settings(dots = TRUE, infinite = FALSE,
               slidesToShow =  1,
               centerMode =FALSE,
              adaptiveHeight = TRUE)   
  })

}

shinyApp(ui = ui, server = server)
LaytonWashburn commented 8 months ago

The main carousel is not duplicated anymore! It's now just the thumbnail being duplicated.

yonicd commented 8 months ago

Thanks for the feedback. Will circle back to this PR to check it out again

yonicd commented 7 months ago

@LaytonWashburn can you give an example of duplicate thumbnails? I cant seem to reproduce that behavior