In my sleek dashboard design, I have implemented a few dropdown menus using selectizeInput. These menus are currently positioned at the bottom of the page, but I want them to open in an upward direction instead of downward.
While I found a workaround for the shinyWidgets
dropdown menu known as pickerInput by following a solution that involved adding a css
tag:
.dropdown-menu{bottom: 100%; top: auto;}
Unfortunately, this approach did not work for the selectizeInput
dropdown. Can anyone suggest the appropriate css
modifications that should be made in my script?
Edit (answered by maartenzam with an example)
library(shiny)
ui <- fluidPage(
# selectize style
tags$head(tags$style(type = "text/css", paste0(".selectize-dropdown {
bottom: 100% !important;
top:auto!important;
}}"))),
div(style='height:200px'),
selectizeInput('id', 'test', 1:10, selected = NULL, multiple = FALSE,
options = NULL)
)
server <- function(input, output, session) {
}
shinyApp(ui, server)