spectrum icon indicating copy to clipboard operation
spectrum copied to clipboard

Chrome: non-passive event listener to scroll-blocking 'touchstart' event

Open alexdiliberto opened this issue 7 years ago • 2 comments

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

alexdiliberto avatar Sep 28 '17 21:09 alexdiliberto

I'm seeing this as well, alexdiliberto. Did you ever find a solution?

swampthang avatar Apr 25 '19 20:04 swampthang

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

alexdiliberto avatar Jun 23 '20 19:06 alexdiliberto