dreamRs / shinyWidgets

shinyWidgets : Extend widgets available in shiny
https://dreamrs.github.io/shinyWidgets/
GNU General Public License v3.0
833 stars 153 forks source link

Any chances for update of virtual-select.js? #672

Closed krystian8207 closed 8 months ago

krystian8207 commented 8 months ago

Hi! Thank you for you hard work on this pretty useful package.

Just wanted to ask if there's possibility to update virtual-select.js version (possibly to the latest one) in the nearest future.

The currently used one (virtual-select@1.0.39) causes pretty annoying behavior when updateVirtualSelect is called on controller that is not visible (I mean you need to scroll to see it). Update method forces the container to be scrolled to the bottom immediately after it's called. See:

library(shiny)
library(shinyWidgets)

ui <- fluidPage(
  tags$h2("Virtual Select"),

  fluidRow(
    column(
      width = 4,
      actionButton("update", "Update"),
      virtualSelectInput(inputId = "single", label = "Single select :", choices = month.name, search = TRUE),
      purrr::map(1:15, shiny::tags$hr),
      virtualSelectInput(
        inputId = "multiple", label = "Multiple select:", choices = setNames(month.abb, month.name),
        selected = "Apr", multiple = TRUE
      )
    )
  )
)

server <- function(input, output, session) {
  observeEvent(input$update, {
    shinyWidgets::updateVirtualSelect("multiple", selected = "Feb")
  })
}

shinyApp(ui, server)

The latest version of js library fixes it. I'd be grateful if you could address my request. Please let me know if I can help in any way.

Best, Krystian

pvictor commented 8 months ago

Hello! Thanks for the kind words. Sure that's done, re-install from GitHub and let me know how it works for you.

Victor

krystian8207 commented 8 months ago

Thank you for so quick reaction, it works!

Krystian