I'm creating a responsive Shiny app and I would like the pickerInputs to adopt the OS's native picker format when a user access it from a mobile in order to prevent the choices being cut off when the screen is smaller, for which I am using mobile = TRUE
as an option for pickerInput()
.
This works great on mobile, but not so much via desktop Chrome or Edge.
Upon investigation it appears to be an issue with multiple = TRUE
also being set - interestingly this does not cause an issue on mobile and both work as intended there. Is it possible for me to have mobile = TRUE
apply only when mobile is true, i.e. when the user is accessing the app via a smart device?
Reproducible example:
library(shiny)
library(shinyWidgets)
ui <- fluidPage(
div(
pickerInput(
inputId = "Title_picker_input",
label = "",
choices = c("A", "B", "C"),
multiple = TRUE,
options = pickerOptions(
mobile = TRUE
)
)
)
)
server <- function(input, output) {
}
shinyApp(ui = ui, server = server)