d3/d3-zoom

Latest Chrome release is throwing warnings over wheel and touchstart handlers

Closed this issue · 3 comments

Not sure why or how it is happening, but for some reason Chrome is marking any of these events as "active". The actual message looks like this:

[Violation] Add non-passive event listener to a scroll-blocking 'wheel' event. Consider marking event handler as 'passive' to make the page more responsive.

We're using a 3rd party library (along with d3), and with one particular test case this happened twice in the same page: one 32 times, and one 360 times.

It looks like this applies to both version 4 and version 3.

Also for the record, we are stuck on version 3 because the 3rd party library we are using has stated that they will not be able to update to version 4.

Passive event listeners are only useful if the listener will not prevent scrolling. Since the zoom behavior prevents scrolling, it cannot be made a passive listener.

https://developers.google.com/web/updates/2016/06/passive-event-listeners

The violation message you are seeing is not visible by default in the developer console. It appears when you change the filtering level of the console to “Verbose”. These messages will go away if you revert the filter to its default setting of “Info”.

screen shot 2017-06-22 at 1 13 53 pm

Not going to re-open the ticket but one thing we noticed, and this very well may be the fault of the Chrome team, is that the number of messages happening (console open or not) kind of blocks the rest of the page.

We'll keep going on it and see if there is a workaround. Thank you sir for your feedback, indeed!