ten1seven / what-input

A global utility for tracking the current input method (mouse/pointer, keyboard or touch).
https://ten1seven.github.io/what-input
MIT License
1.35k stars 89 forks source link

Consider using “passive” event listener for mouse wheel event #63

Closed tedw closed 7 years ago

tedw commented 7 years ago

FYI, Chrome displays the following message in the console in “verbose” mode:

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

Is there any downside to converting to “passive” event listeners?

More info: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md

Thanks for everyone’s hard work on this! I use it on all my projects.

ten1seven commented 7 years ago

Thanks @tedw, I'll get this rolled in!

ten1seven commented 7 years ago

@tedw just added this, verified that it adds the listener passively and removes the alert from the console and published a new package.

tedw commented 7 years ago

@ten1seven Awesome, thanks!