shinyWidgets
shinyWidgets copied to clipboard
virtualSelectInput hides element name when only one element for one group is present
Hi devs,
Reporting following bug, with reproducible example:
library("shiny")
ui <- fluidPage(
shiny::HTML("<br><br>"),
shinyWidgets::virtualSelectInput(
"test_id",
"Label",
list("A group" = c("An element of this group"))
)
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
Result:
The element name itself is thus hidden; only the group name is shown. Using two elements, the behavior is ok, and both group name and elements are shown:
Any ideas how to circumvent this?
Thanks!
Lennart
Hello,
If there's only one element in a group you need to use a list rather than a vector, e.g. :
list("A group" = list("An element of this group"))
Thanks for the quick response. Can confirm that this work-around works.