Reputation: 322
With Shiny when you use SelectizeInput
with multiple = TRUE
:
When the list is very long, sometimes the point 1 is pointless. Is it possible to see the dropdown only when you start typing (only from point 2)?
Reproducible example:
ui <- fluidPage(
selectizeInput(
inputId = "TEST", label = NULL, choices = c("aa","ab","ac","dd","de","zzz"),
multiple = TRUE)
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
Upvotes: 1
Views: 367
Reputation: 13125
selectizeInput
has an options argument, which is a list of parameters to initialize the selectize input. One of these options is openOnFocus
which is
Show the dropdown immediately when the control receives focus.
Turning off openOnFocus
solves the issue.
selectizeInput(
inputId = "TEST", label = NULL, choices = c("aa","ab","ac","dd","de","zzz"),
multiple = TRUE,
options = list(openOnFocus = FALSE,
#If the user write aa then delete it all, the complete list will show up again,
#use maxOptions to solve this issue
maxOptions = 3))
See the full list here selectize / selectize.js.
Upvotes: 2