I am trying to increase the length of the dropdown list when using selectizeInput in Shiny.
I know I can set the max number of items shown by: options = list(maxOptions = n)
but how could I define a minimum number of options?
I am trying to increase the length of the dropdown list when using selectizeInput in Shiny.
I know I can set the max number of items shown by: options = list(maxOptions = n)
but how could I define a minimum number of options?
As said in the comments, there is no minimum number of options setting, at least none that I know of. However, since you're trying to increase the length of the dropdown, you can just do that with CSS.
Suppose this is your dropdown:
selectizeInput("select", "Select multiple options",
choices = LETTERS, multiple = T
),
Just add:
tags$style(type='text/css',
".selectize-dropdown-content {
max-height: 600px; ## CHANGE THIS
}"
)
And you get:
As a minimal example, try this:
library(shiny)
ui <- fluidPage(
selectizeInput("select", "Select multiple options",
choices = LETTERS, multiple = T
),
tags$style(type='text/css',
".selectize-dropdown-content {
max-height: 600px;
}"
)
)
server <- function(input, output){}
shinyApp(ui=ui, server=server)
© 2022 - 2024 — McMap. All rights reserved.
maxOptions
. I guess you might be able to change its height using CSS. I have not tried, though. – Camenae