vasturiano/d3-geo-zoom

add mouse event handlers as passive

Closed this issue · 2 comments

Chrome is yelling at me.
[Violation] Added non-passive event listener to a scroll-blocking 'wheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952

I'll poke around and see what I can see. Comments requested.

@antonytrupe thanks for reaching out.

I believe those events are happening on d3-zoom, a dependency from this module.
More specifically on these event bindings:
https://github.com/d3/d3-zoom/blob/c2fa6048ef0f6d4972df5b08cf66317b04b3c5de/src/zoom.js#L76-L81

However, as can be seen from the d3-zoom event details, quite a few of these listeners prevent the default behavior by design, so I'm not certain they can even be made passive to begin with.