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

Add support for passive event listeners #3604

Closed
samuelli opened this issue Apr 20, 2016 · 16 comments
Closed

Add support for passive event listeners #3604

samuelli opened this issue Apr 20, 2016 · 16 comments

Comments

@samuelli
Copy link
Member

Echoing @RByers on pushing for support of passive event listeners which could see fairly significant scrolling performance improvements across the board.

Request on jquery: jquery/jquery#2871
Explainer: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md
Chrome status page: https://www.chromestatus.com/features/5745543795965952

This hits Chrome Stable (51) in about a month.

@LostInBrittany
Copy link

Hi! Is there any info of if/when passive listeners will land on Polymer?

@ZachMoreno
Copy link

👍

@ebidel
Copy link
Contributor

ebidel commented Mar 22, 2017

Related: #3787

@Joel-hanson
Copy link

how to do it for polymer elements
does the defer attribute help

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

@azakus any progress?

@matthew-dean
Copy link

I believe this was incorrectly closed by #4829 which toggles passive gestures app-wide, whereas there needs to be a Polymer way to add passive event listeners on an ad-hoc basis, which is what this issue is about.

@matthew-dean
Copy link

matthew-dean commented Nov 2, 2017

[Ping] This issue should not be closed. The app-wide toggle for passive gestures has nothing to do with this.

@samuelli
Copy link
Member Author

samuelli commented Nov 2, 2017

@azakus: can you comment on this?

@dfreedm
Copy link
Member

dfreedm commented Nov 2, 2017

@matthew-dean Ah, that is not how I interpreted this issue, but we have no plans to support using passive gestures via syntax.

If you need that, I would suggest removing on- listeners and using node.addEventListener(gesture, fn, {passive: true})

@dfreedm
Copy link
Member

dfreedm commented Nov 2, 2017

On second thought, you were asking about adding passive gesture events I see.
Yeah, I think we could make that work.

@newlukai
Copy link

newlukai commented Dec 8, 2017

Would be really great to have this on component level in Polymer 1.x.

I just checked in my app which listeners cause this message. It seems that I've this issue only with touchstart and touchmove dependencies of declarative tap, track and downup events. I think a possible solution would be to add tap-passive, track-passive and downup-passive events. While registering those Gestures, the info property of this gesture could transport a passive property to the actual listener creation.

It would work without too much changes. On the other hand, what if one wants to get more information to the event creation? Registering the gesture tap-passive-fancy-cool and all of its combinations isn't very elegant.

@matthew-dean
Copy link

@azakus Yeah, I'm working with Polymer 2 now, and you definitely can handle passive events that way. It's just not in the declarative portion of Polymer. Could be something like on-tap.passive="_handler".

@ArthurJahn
Copy link

Any progress here?

@nazar-pc
Copy link
Contributor

nazar-pc commented Apr 5, 2018

#4829 landed optional support for passive listeners on application level using Polymer.passiveTouchGestures = true and it works (at least, Chromium doesn't complain about non-passive listeners anymore).

@stale
Copy link

stale bot commented Mar 13, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 13, 2020
@stale
Copy link

stale bot commented Apr 17, 2022

This issue has been automatically closed after being marked stale. If you're still facing this problem with the above solution, please comment and we'll reopen!

@stale stale bot closed this as completed Apr 17, 2022
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

13 participants