继续这里提到的讨论:
Remove "Select All" action button from pickerInput using shinywidgets
OP具有此代码,并尝试删除其中一个选择/取消选择按钮:
pickerInput(inputId = "country_select_list", label = "Select countries", choices = country_list, multiple = TRUE, options = pickerOptions(actionsBox = TRUE))答案是利用CSS:
.bs-select-all {
display: none;
}到底应该将这部分代码放在什么位置,以便select-all按钮消失?
发布于 2021-04-13 21:24:44
尝尝这个
library(gapminder)
my_css <- "
.bs-select-all {
display: none;
}
.bs-deselect-all {
width: 100%;
}
"
df <- gapminder
country_list <- unique(df$country)
ui <- fluidPage(
tags$head(tags$style(HTML(my_css))),
pickerInput(
inputId = "country_list",
label = "Select countries",
choices = as.character(country_list),
multiple = TRUE,
options = pickerOptions(actionsBox = TRUE)
)
)
server <- function(input, output) {}
shinyApp(ui, server)https://stackoverflow.com/questions/67074985
复制相似问题