In my shiny dashboard I have a couple of dropdown menus of type selectizeInput. They are located at the bottom of the page, so instead of opening the dropdown menus downward I would like to open them upward.
I did find a solution for the shinyWidgets
dropdown menu called pickerInput. The solution here was to add a css
tag:
.dropdown-menu{bottom: 100%; top: auto;}
However, this tag isn't working for selectizeInput
. Any idea which css
I have to add to my script?
Edit (answer by maartenzam with 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)
You can do somethink like
.selectize-dropdown {
top: -200px !important;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With