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

Perf: Do not add document-level blocking touch listeners #3787

Closed
ebidel opened this issue Jul 20, 2016 · 5 comments
Closed

Perf: Do not add document-level blocking touch listeners #3787

ebidel opened this issue Jul 20, 2016 · 5 comments

Comments

@ebidel
Copy link
Contributor

ebidel commented Jul 20, 2016

All polymer apps get a touch listener added to document by default?

screen shot 2016-07-19 at 5 46 31 pm

screen shot 2016-07-19 at 5 47 01 pm

screen shot 2016-07-19 at 5 47 29 pm

Doing so is typically frowned upon b/c it can have negative effects on page load and scrolling perf, especially on mobile. What are these events for? Can they be passive events by default...or can we have users opt-into passive events somehow if they know they're not going to call preventDefault()?

https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md

cc @RByers @azakus

@ebidel ebidel changed the title Polymer adds touch listen to document by default Polymer adds document-level blocking touch listeners Jul 20, 2016
@ebidel ebidel changed the title Polymer adds document-level blocking touch listeners Perf: Do not add document-level blocking touch listeners Jul 21, 2016
@RByers
Copy link

RByers commented Jul 29, 2016

Back in the day I know @azakus worked to ensure this wasn't necessary (it was the main original concern from abarth@ about the PointerEventPolyfill IIRC). We're pretty close to forcing all touch listeners on the document to be passive by default anyway - you can enabled this in chrome://flags, and I haven't noticed any issues with polymer. So perhaps it's easy to just make these listeners passive?

@eduardosada
Copy link

What can we do about this? Any idea?

@esd100
Copy link

esd100 commented Jun 9, 2017

What is going here and why is there no final answer?

I'm getting thousands of console warnings:
Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive.

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
@bennypowers
Copy link

Is this the _globalOnClick listener in iron-location?

@Thkasis
Copy link

Thkasis commented Aug 30, 2017

Just wondering if there's any updates on this?!

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

7 participants