Open 2803media opened 3 years ago
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});
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