marekrozmus / react-swipeable-list

Swipeable list component for React supporting several behaviours (e.g. iOS)
https://marekrozmus.github.io/react-swipeable-list/
MIT License
114 stars 20 forks source link

Compatibility issue with newer Chromium #23

Closed lbialy closed 1 year ago

lbialy commented 2 years ago

I get a lot of:

[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

in console when using your library in a toy project.

This is the line that triggers it: this.listElement.addEventListener('touchstart', this.handleDragStartTouch);

Sorry, I have no clue about why this happens or whether that's not a problem (I see that you do add passive: true for touchmove event), I'm a backend guy mostly.

marekrozmus commented 2 years ago

Hi :) Are you able to repro that on the demo page: https://marekrozmus.github.io/react-swipeable-list/ ? Which version of Chromium exactly - I tried the demo page on just downloaded canary version and nothing in console 🤷‍♂️

Maybe it is some specific case of scrollable area in scrollable area - just guessing.

lbialy commented 2 years ago

The version is Version 100.0.4896.127 (Official Build) (64-bit), I can repro it on the demo page actually:

non-passive-event-listener

marekrozmus commented 2 years ago

you need to help me out here - I cannot find that version (got only newer) and not quite sure which Chromium channel are you using. If it possible please provide me a link :)

lbialy commented 2 years ago

Well, it's an ArchLinux, pacman tells me this:

λ pacman -Q google-chrome
google-chrome 100.0.4896.127-1
marekrozmus commented 2 years ago

I have tested with Chromium on Windows and Mac and I have no warnings. I cannot test it with Linux. I am wondering why the linux version is so "old" - like "100" - I have at least "101". If the lib will cause you some other problems then please let me know.

JonasDoesThings commented 1 year ago

I Can reproduce this warning message on the Demo Page using Chrome 108.0.5359.99 on Windows 11.

Seems like react-swipeable has included a solution for this problem in their latest 7.0.0 release^1 to prevent these warnings, and thus the point subtraction from the PageSpeed audit score. Maybe seeing how they solved it can help.