Skip to content

Improve search/multiselect on input_select #1218

Open
@corey-dawson

Description

@corey-dawson

The python version of selectInput has some nice features, such as nesting dictionaries as selectable values, however, lacks functionality in multiselect and searching to satisfy a wide range of application needs. My recommendation is to take inspiration from the R shinywidgets pickerInput which implements a much enhanced input with options for everything mentioned below

R picker input reference

R Shiny PickerInput

Recommended Enhancements

Multi-select improvements

  1. should have an option to add select all / deselect all button
  2. should have an option to change multiselect highlighting to adding a check next to the selected
  3. Should have an option to display the number of rows selected after n selections

Search

  1. should have a search bar option

R Example Code with Better Select Input

library(shiny)
library(shinyWidgets)
library(base)

states <- state.abb

ui <- fluidPage(
  pickerInput(
    inputId = "input_state",
    label = "Select State[s]",
    choices = states,
    multiple = TRUE,
    options = list(
      `actions-box` = TRUE, # add select / deselect all
      `live-search` = TRUE, # add search bar
      `selected-text-format` = "count > 2" # show count once 3 items selected
    )
  ),
  verbatimTextOutput("value")
)

server <- function(input, output) {
  output$value <- renderPrint(input$somevalue)
}

shinyApp(ui, server)

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions