I want to create a button dropdown. I'd love to use shinyWidgets::dropdownButton()
, but that one has a problem, because it doesn't allow shinyWidgets::pickerInput()
to be inside it. It is recommended to use shinyWidgets::dropdown()
to be used with the pickerInput.
The problem I'm having is that I'm not able to programatically toggle the dropdown:
library("shiny")
library("shinyWidgets")
ui <- fluidPage(
fluidRow(
column(6,
dropdown(
actionButton("but1", "Close"),
label = "Drop 1",
inputId = "drop1"
)
),
column(6,
dropdownButton(
actionButton("but2", "Close"),
label = "Drop 2",
inputId = "drop2"
)
)
)
)
server <- function(input, output, session) {
observeEvent(input$but1, {
toggleDropdownButton("drop1", session)
})
observeEvent(input$but2, {
toggleDropdownButton("drop2", session)
})
}
shinyApp(ui, server)
Is there some way to do it?
Thanks