d3 / d3-brush

Select a one- or two-dimensional region using the mouse or touch.
https://d3js.org/d3-brush
ISC License
155 stars 54 forks source link

Errors when using `filter` on mobile #96

Open sheldonbaker opened 1 year ago

sheldonbaker commented 1 year ago

On a mobile device, when using brush.filter, any events that are removed by the filter will end up causing an error of emitter(...).moved is not a function or emitter(...).touchended is not a function.

function touchmoved(event) {
  emitter(this, arguments).moved(event);
}

function touchended(event) {
  emitter(this, arguments).ended(event);
}

https://codepen.io/sheldoncodes/pen/jOxvmdq (simulate a mobile device in your devtools).

muellnerlisa commented 10 months ago

I am experiencing the exact same issue, did anyone find a solution for this error?

sheldonbaker commented 10 months ago

I am experiencing the exact same issue, did anyone find a solution for this error?

No, I just had to filter the specific error message so it stays out of my logs.