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

gestures.html adds non-passive event listener to a scroll-blocking 'touchstart' event #4667

Closed
valdrinkoshi opened this issue Jun 6, 2017 · 9 comments
Assignees
Labels

Comments

@valdrinkoshi
Copy link
Member

This causes chrome to log Violation warnings
screen shot 2017-06-05 at 5 04 35 pm

@dfreedm dfreedm self-assigned this Jun 6, 2017
@dfreedm
Copy link
Member

dfreedm commented Jun 6, 2017

I will need this to be non-passive for browsers that don't support native touch-action, but I can make this better for Chrome

@BoefAE
Copy link

BoefAE commented Jun 19, 2017

I'm having the same issue, simular issue seems to appear on FireFox as well.
I'm using paper-swatch element which seems to cause the majority of these violations, fyi

@davidmaxwaterman
Copy link

I get thousands of these messages in my 1.9 app, all originating from within Polymer. I guess they're not from the same file since it's 2.x (right?), though I'm not too sure how to find that out. Is there any hope of getting these messages removed in 1.9 too?

@dfreedm
Copy link
Member

dfreedm commented Jun 22, 2017

Hmm, I'm worried about the backwards compatibility with this change given the fact that gestureEvent.preventDefault() can call touchEvent.preventDefault(). Maybe this is best served as an opt-in for 2.x.

@BoefAE
Copy link

BoefAE commented Jun 25, 2017

Updated gestures.html with your update, works fine now. T.hanks!

dfreedm added a commit that referenced this issue Jul 5, 2017
Provide a way for elements to have passive gesture listeners with
this._passiveGestures = true;

Fixes #4667
Fixes #3787
Fixes #3604
@krisu7
Copy link

krisu7 commented Aug 10, 2017

Hi, when can I expect this fix to be released? I just noticed this issue in chrome lighthouse.

@TimvdLippe
Copy link
Contributor

@krisu7 when #4724 is merged. The problem there is that we are not able to (regression) test the feature

@govis
Copy link

govis commented Nov 21, 2018

[Violation] Added non-passive event listener to a scroll-blocking event. Consider marking event handler as 'passive' to make the page more responsive. seems to be back in Polymer 3.

I have setPassiveTouchGestures(true); and use passive gesture listeners as per https://polymer-library.polymer-project.org/2.0/docs/devguide/gesture-events#use-passive-gesture-listeners

Also "Use passive gesture listeners" section is missing form the Polymer 3 Gesture Events TOC: https://polymer-library.polymer-project.org/3.0/docs/devguide/gesture-events

@govis
Copy link

govis commented Nov 21, 2018

It looks like we may need to set setPassiveTouchGestures(true); before importing any elements that may add gesture listeners in its constructor

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

No branches or pull requests

7 participants