在我 Shiny 的仪表板中,我有几个 selectizeInput 类型的下拉菜单.它们位于页面底部,所以我不想向下打开下拉菜单,而是向上打开它们。
我确实找到了 solution对于名为 pickerInput 的 shinyWidgets
下拉菜单.这里的解决方案是添加一个 css
标签:
.dropdown-menu{bottom: 100%; top: auto;}
但是,此标记不适用于 selectizeInput
。知道我必须将哪个 css
添加到我的脚本中吗?
编辑(maartenzam 以示例回答)
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)
最佳答案
你可以做类似的事情
.selectize-dropdown {
top: -200px !important;
}
关于html - Shiny 的选择下拉菜单向上打开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52270897/