-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for 'Passive event listeners' to improve page scroll performance #16
Comments
Oh I didn't know such issues could trigger runtime errors (is this an error or warning?). I've always used this library for "drawing" kind of events and so always needed to prevent mobile browser passive events handling like scrolling and such (which would mess with the drawing action). I'll look into it more when I have a bit of time (might not be in the next two weeks). Thanks a lot for the report! Meanwhile, I believe elm 0.19 automatically make events passive when we are not using |
Ah yes it's only a warning. I'll update my post above.
Thank you!!
Interesting. Currently we're on 0.18, keen to upgrade soon though.
Cheers. We'll have a look and try with |
Hi, I'm doing a little round of the open issues. I don't have enough time these days to try to maintain a 0.18 version. Did you, by any chance, try to update your gestures code to 0.19? Is it also producing this warning? |
Implementing a horizontal swipe using touch events with this library started producing this warning in our console:
Main.elm:8830 [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
Further research brought us to this explanation on caniuse:
ref: https://caniuse.com/#feat=passive-event-listener
Our use case is that of having a scrollable list of items on a mobile device and that each item is the full width of the screen and is swipable. Here's an example (in JS) for illustration: http://jsfiddle.net/evolve2k/afkdtjh9/14/
We're interested in how we can utilise passive event listeners with this library.
Can you see a way of doing this?
The text was updated successfully, but these errors were encountered: