spectrum
spectrum copied to clipboard
Chrome: non-passive event listener to scroll-blocking 'touchstart' event
Seeing a Chrome Violation in console output from Chrome 61 related to event listener performance. The code that initiates the chrome violation is here:
https://github.com/bgrins/spectrum/blob/1.8.0/spectrum.js#L307
[Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
... // Start stack trace
| initialize | @ | spectrum.js:307
| spectrum | @ | spectrum.js:952
... // Continue stack trace
I'm seeing this as well, alexdiliberto. Did you ever find a solution?
I believe we'll need to add the passive
option when setting any event listeners which don't call preventDefault
. This library currently uses jQuery and jQuery isn't planning to support passive
event listeners until their 4.0 release