是否可以在boxDropdown中使用selectInput?一旦我尝试选择一个项目,下拉菜单就会关闭。如果用户没有完全点击按钮,它似乎会关闭。如果我稍微按下 checkboxGroupInput 的复选框下方,它会关闭,但如果我准确地单击按钮则不会。它不会将 selectInput 识别为按钮吗?
如何让 selectInput 在 boxDropdown 中工作? 它在 boxSidebar 中运行良好。
谢谢!
library(shiny)
library(shinydashboard)
library(shinydashboardPlus)
ui = dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody(
box(
title = "Test App for selectInput in dropdown",
dropdownMenu = boxDropdown(
checkboxGroupInput("checkbox", "Check", c("a", "b", "c")),
boxDropdownItem(selectInput("selectinput", "Select", c("a", "b", "c")))
),
plotOutput("distPlot")
)
)
)
server = function(input, output) {
output$distPlot <- renderPlot({
hist(100)
})
}
shinyApp(ui, server)