Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Select Multiple Items in Dropdown() #29

Closed
kyle-power opened this issue Apr 29, 2021 · 2 comments
Closed

Unable to Select Multiple Items in Dropdown() #29

kyle-power opened this issue Apr 29, 2021 · 2 comments

Comments

@kyle-power
Copy link

When using Dropdown() or updateDropdown() with multiSelect = TRUE, users are unable to select/click items.

updateDropdown(session = session, input_id = "equipment", 
               label = "Select Desired Equipment", placeholder = "Select an option...",
               options = y, styles = list(root = list(width = "10vw"), 
               dropdownItemsWrapper = list(`max-height` = "400px", overflow = "auto")),
               multiSelect = TRUE, disabled = FALSE)

Checkboxes are "greyed out" and not able to clicked
image

@kyle-power kyle-power added the bug label Apr 29, 2021
@kyle-power
Copy link
Author

Not sure if I need to tag anyone... @kamilzyla sorry to bother you again

@kamilzyla
Copy link
Collaborator

Hey @kyle-power! You're not bothering at all - thanks for reporting this and sorry for the late response.

The behavior you described is also present in the newest 0.2.0 release of shiny.fluent and it is due to a limitation in our wrapper implementation. For now, the simplified Dropdown.shinyInput doesn't work with multiselect = TRUE.

It is possible to use multiselect with the bare React interface, but it will require some gymnastics. You can play with this example to see how it works:

shinyApp(
  ui = fluentPage(
    textOutput("value"),
    Dropdown(
      onChange = setInput("dropdown", 2),
      options = list(
        list(key = "A", text = "Option A"),
        list(key = "B", text = "Option B")
      ),
      multiSelect = TRUE
    ),
  ),
  server = function(input, output) {
    output$value <- renderText(deparse(input$dropdown))
  }
)

We should be able to add support for multiSelect = TRUE in a future release. I created a feature request for this in #42.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants