cubiq / iscroll

Smooth scrolling for the web
http://iscrolljs.com
MIT License
12.87k stars 3.8k forks source link

`cosole.error` for passive event listener in Chrome54+ #1119

Closed sculove closed 7 years ago

sculove commented 7 years ago

I test iScroll demo file in Chrome55. I'm face a error message.

2016-12-29 10 37 55

There is an error in this code.

document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);

cause

If an event listener is added to the document, body, or window and is a scroll blocking (touchstart, touchmove) listener it will be have passive options to be true and we will face a following error

RByers commented 7 years ago

As for the warning from Chrome: sorry for the trouble, this is a breaking change in Chrome 56 to improve scroll performance. There's probably a missing touch-action CSS rule, which is necessary to support touch on IE/Edge anyway.