diff --git a/NEWS.md b/NEWS.md index 10b77786eb..d1d1367669 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ ## BUG FIXES +* Duplicate `highlight(selectize=T)` dropdowns are no longer rendered in Shiny (#1936). * `group_by.plotly()` now properly retains crosstalk information across `{dplyr}` versions (#1920). # 4.9.3 diff --git a/R/utils.R b/R/utils.R index 988bc91a85..46a0e02f0c 100644 --- a/R/utils.R +++ b/R/utils.R @@ -379,7 +379,7 @@ supply_highlight_attrs <- function(p) { # include one selectize dropdown per "valid" SharedData layer if (isTRUE(p$x$highlight$selectize)) { - p$x$selectize[[new_id()]] <- list( + p$x$selectize[[i]] <- list( items = data.frame(value = k, label = k), group = i ) } diff --git a/inst/htmlwidgets/plotly.js b/inst/htmlwidgets/plotly.js index a625ab2e44..56d3491d65 100644 --- a/inst/htmlwidgets/plotly.js +++ b/inst/htmlwidgets/plotly.js @@ -74,7 +74,7 @@ HTMLWidgets.widget({ }); // inject a "control panel" holding selectize/dynamic color widget(s) - if (x.selectize || x.highlight.dynamic && !instance.plotly) { + if ((x.selectize || x.highlight.dynamic) && !instance.plotly) { var flex = document.createElement("div"); flex.class = "plotly-crosstalk-control-panel"; flex.style = "display: flex; flex-wrap: wrap";