Skip to content

Commit e02a704

Browse files
committed
Follow up to #1936: hash the selectize id so it can be used as an HTML id
Fixes this reprex https://github.com/ropensci/plotly/pull/1936\#issuecomment-820616142
1 parent 3581d7a commit e02a704

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Imports:
4242
vctrs,
4343
tibble,
4444
lazyeval (>= 0.2.0),
45-
rlang,
45+
rlang (>= 0.4.10),
4646
crosstalk,
4747
purrr,
4848
data.table,

R/utils.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,9 @@ supply_highlight_attrs <- function(p) {
379379

380380
# include one selectize dropdown per "valid" SharedData layer
381381
if (isTRUE(p$x$highlight$selectize)) {
382-
p$x$selectize[[i]] <- list(
382+
# Hash i (the crosstalk group id) so that it can be used
383+
# as an HTML id client-side (i.e., key shouldn't contain spaces)
384+
p$x$selectize[[rlang::hash(i)]] <- list(
383385
items = data.frame(value = k, label = k), group = i
384386
)
385387
}

0 commit comments

Comments
 (0)