Hi,
I have 2 dropdowns in below example - attempting to update choices in dropdown 2 with values selected in dropdown 1, while also retaining previously selected choices in dropdown 2. You can reproduce error by: first selecting "a" in dropdown 2, then, selecting "a", "b", "c" in dropdown 1, then attempting to change selections in dropdown 2 with newly available choices from dropdown1 will disable further selections..
Note: Also tried using observereEvent(input$dropddown1{...}) for the update_material_dropdown observer but the issue where user cannot further select choices in dropdown2 still appears (although delayed).
library(shinymaterial)
library(shinyjs)
ui <- material_page(
useShinyjs(),
material_dropdown("dropdown1", label = "dropdown1", choices = c("a","b","c","d"), multiple = TRUE),
material_dropdown("dropdown2", label = "dropdown2", choices = c("a","b","c","d"), multiple =TRUE)
)
server <- function(input, output, session){
reactives <- reactiveValues(
val = list()
)
observe({
reactives$val$choices <- input$dropdown1
reactives$val$values <- input$dropdown2
}, priority = 1)
observe({
update_material_dropdown(session, input_id = "dropdown2", choices = reactives$val$choices, value = reactives$val$values )
})
}
shinyApp(ui, server)
Thanks again for your work on this package, this functionality seems to be quite important that it works correctly.
Hi,
I have 2 dropdowns in below example - attempting to update choices in dropdown 2 with values selected in dropdown 1, while also retaining previously selected choices in dropdown 2. You can reproduce error by: first selecting "a" in dropdown 2, then, selecting "a", "b", "c" in dropdown 1, then attempting to change selections in dropdown 2 with newly available choices from dropdown1 will disable further selections..
Note: Also tried using
observereEvent(input$dropddown1{...})for theupdate_material_dropdownobserver but the issue where user cannot further select choices in dropdown2 still appears (although delayed).Thanks again for your work on this package, this functionality seems to be quite important that it works correctly.