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

Adding passive event listeners #4393

Closed
a1626 opened this issue Mar 8, 2017 · 6 comments
Closed

Adding passive event listeners #4393

a1626 opened this issue Mar 8, 2017 · 6 comments
Assignees

Comments

@a1626
Copy link

a1626 commented Mar 8, 2017

Description

DevTool of chrome canary in verbose mode gives a violation

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

This violation comes for touchstart and mousewheel events

Steps to Reproduce

  1. Create a small demo application using Polymer
  2. Open the application in chrome canary
  3. In console of devTool switch level to verbose.

Versions

  • Polymer: v1.X.X
  • webcomponents: vX.X.X
@khammami
Copy link

I analyzed my app with Lighthouse
2017-03-10_113815

it suggest to uses passive listeners to improve scrolling performance.

@wingliu0
Copy link

@khammami I got the same warning too. But the one adding non-passive listeners is polymer itself.. and some iron component. How should we replace that?

@khammami
Copy link

Hi @wingliu0, here what I found about passive events. touch listeners should be annotated with {passive: true}. I believe the best way to replace them is by reporting each non passive listener you find to the team.

@wingliu0
Copy link

@khammami true, but will they still maintain the polymer 1.x?

@khammami
Copy link

@wingliu0 I think so, at least till the final release of v2

@ebidel ebidel changed the title Adding non-passive event listeners Adding passive event listeners Mar 22, 2017
@ebidel
Copy link
Contributor

ebidel commented Mar 22, 2017

Dupe of #3604

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

5 participants