ramonszo/zuck.js

zuck.js [Violation] Added non-passive event listener to a scroll-blocking 'touchmove' event.

leftysarl opened this issue · 2 comments

Hello @ramon82

I got an issue with a website on sf5 / php 7.4 running with boostrap and jquery.
Here are the issues i got when i try to navigate (previous / next):

[Violation] Added non-passive event listener to a scroll-blocking event. Consider marking event handler as 'passive' to make the page more responsive. See
zuck.js:710 [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
createStoryTouchEvents @ zuck.js:710
callback @ zuck.js:726
onOpen @ zuck.js:237
show @ zuck.js:781
story.onclick @ zuck.js:923
zuck.js:589 [Violation] Added non-passive event listener to a scroll-blocking 'touchmove' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
touchStart @ zuck.js:589
zuck.js:589 [Violation] Added non-passive event listener to a scroll-blocking 'touchmove' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
touchStart @ zuck.js:589
zuck.js:589 [Violation] Added non-passive event listener to a scroll-blocking 'touchmove' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
touchStart @ zuck.js:589
zuck.js:589 [Violation] Added non-passive event listener to a scroll-blocking 'touchmove' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
touchStart @ zuck.js:589
zuck.js:589 [Violation] Added non-passive event listener to a scroll-blocking 'touchmove' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952

i think we need to edit like that:
if (enableMouseEvents) { modalSlider.addEventListener('mousemove', touchMove, { passive: true}); modalSlider.addEventListener('mouseup', touchEnd, { passive: true}); modalSlider.addEventListener('mouseleave', touchEnd, { passive: true}); } modalSlider.addEventListener('touchmove', touchMove, { passive: true}); modalSlider.addEventListener('touchend', touchEnd, { passive: true});

Let me know what did you think, but actually my navigation does not work.

with passive true its better, now i can go on so it fix the issue.

setting passive events break other things, so it wont be changed for now