Skip to content
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

"Non-passive event listener" warning. #15

Open
ojvribeiro opened this issue Sep 17, 2017 · 1 comment
Open

"Non-passive event listener" warning. #15

ojvribeiro opened this issue Sep 17, 2017 · 1 comment

Comments

@ojvribeiro
Copy link

ojvribeiro commented Sep 17, 2017

I'm receiving this warning in the console:

[Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive.

Should I have to worry?

@matthias-vogt
Copy link
Owner

Not really.
This is what passive event listeners do: https://stackoverflow.com/a/37721906
Sadly, jquery doesn't support them natively. You could work around this, though.
The lib actually currently uses one touchstart listener on the document for every element with ripples while, theoretically, only one global one would be needed.
I did a quick test and, unless you have an obscene amount of ripple elements there shouldn't be an impact.
http://jsbin.com/wanorosupe/1/edit
#11 related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants