Echoing @RByers on pushing for support of passive event listeners which could see fairly significant scrolling performance improvements across the board.
Request on jquery: https://github.com/jquery/jquery/issues/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.
Hi! Is there any info of if/when passive listeners will land on Polymer?
馃憤
how to do it for polymer elements
does the defer attribute help
@azakus any progress?
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.
[Ping] This issue should not be closed. The app-wide toggle for passive gestures has nothing to do with this.
@azakus: can you comment on this?
@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})
On second thought, you were asking about adding passive _gesture_ events I see.
Yeah, I think we could make that work.
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.
@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".
Any progress here?
Polymer.passiveTouchGestures = true and it works (at least, Chromium doesn't complain about non-passive listeners anymore).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.
Most helpful comment
Hi! Is there any info of if/when passive listeners will land on Polymer?