diff --git a/NEWS.md b/NEWS.md index 26a38bc5e2..efdd3fcaa5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -11,6 +11,7 @@ * `ggplotly()` now correctly handles `geom_tile()` with no `fill` aesthetic. (#2063) * `ggplotly()` now respects `guide(aes = "none")` (e.g., `guide(fill = "none")`) when constructing legend entries. (#2067) * Fixed an issue with translating `GGally::ggcorr()` via `ggplotly()`. (#2012) +* Fixed an issue where clearing a crosstalk filter would raise an error in the JS console (#2087) ## Improvements diff --git a/inst/htmlwidgets/plotly.js b/inst/htmlwidgets/plotly.js index aaca427af0..1155269d37 100644 --- a/inst/htmlwidgets/plotly.js +++ b/inst/htmlwidgets/plotly.js @@ -616,9 +616,9 @@ TraceManager.prototype.updateFilter = function(group, keys) { traces.push(trace); } } + this.gd.data = traces; } - this.gd.data = traces; Plotly.redraw(this.gd); // NOTE: we purposely do _not_ restore selection(s), since on filter,