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

Uses passive listeners to improve scrolling performance #289

Closed
wants to merge 1 commit into from
Closed

Uses passive listeners to improve scrolling performance #289

wants to merge 1 commit into from

Conversation

alvaxet
Copy link

@alvaxet alvaxet commented Sep 11, 2019

Hi,

First of all - thank you for the nice library!

It seems like there is a small space for improvement. I've been running a website audit using google devtools/Lighthouse and I've got this kind of recommendation:
DeepinScreenshot_select-area_20190911213052

This is it (Learn more link from the screenshot above): https://developers.google.com/web/tools/lighthouse/audits/passive-event-listeners?utm_source=lighthouse&utm_medium=devtools

Recommendations
Add the passive flag to all of the event listeners that Lighthouse has identified. In general, add the passive flag to every wheel, mousewheel, touchstart, and touchmove event listener that does not call preventDefault().

There are a few event listeners (touchstart and touchmove) in the slideout that do not have passive: true on them. That's what I fix with this PR. I didn't commit compiled files

Audit results after the fix:
DeepinScreenshot_select-area_20190911214153

@coveralls
Copy link

Coverage Status

Coverage remained the same at 69.88% when pulling 2f15ae8 on alvaxet:touch-performance into 6eb8440 on Mango:master.

@alvaxet alvaxet changed the title Fix touch performance Uses passive listeners to improve scrolling performance Sep 11, 2019
@alvaxet alvaxet closed this Sep 11, 2019
@inoas
Copy link

inoas commented Apr 10, 2020

Why didnt this get merged?

inoas added a commit to inoas/slideout that referenced this pull request Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants