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

Lighthouse error "passive listeners" #66

Open
2803media opened this issue Feb 3, 2021 · 1 comment
Open

Lighthouse error "passive listeners" #66

2803media opened this issue Feb 3, 2021 · 1 comment

Comments

@2803media
Copy link

Hi the last version generate an error in lighthouse :

Does not use passive listeners to improve scrolling performance

More info here : https://web.dev/uses-passive-event-listeners/?utm_source=lighthouse&utm_medium=devtools

@2803media
Copy link
Author

FYI just change thoses lines:

this._map._container.addEventListener("touchstart", this._handleTouch);
this._map._container.addEventListener("touchmove", this._handleTouch);
this._map._container.addEventListener("touchend", this._handleTouch);
this._map._container.addEventListener("touchcancel", this._handleTouch);
this._map._container.addEventListener("click", this._handleTouch);

to

this._map._container.addEventListener("touchstart", this._handleTouch, {passive: true});
this._map._container.addEventListener("touchmove", this._handleTouch, {passive: true});
this._map._container.addEventListener("touchend", this._handleTouch, {passive: true});
this._map._container.addEventListener("touchcancel", this._handleTouch, {passive: true});
this._map._container.addEventListener("click", this._handleTouch, {passive: true});

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

No branches or pull requests

1 participant