maoberlehner / vue-lazy-hydration

Lazy Hydration of Server-Side Rendered Vue.js Components
MIT License
1.18k stars 52 forks source link

Add support of passive listener for scroll for lazy hydration on touchstart #59

Closed asennoussi closed 3 years ago

asennoussi commented 3 years ago

Hi again, Touch and wheel event listeners are useful for tracking user interactions and creating custom scrolling experiences, but they can also delay page scrolling. Currently, browsers can't know if an event listener will prevent scrolling, so they always wait for the listener to finish executing before scrolling the page. Passive event listeners solve this problem by letting you indicate that an event listener will never prevent scrolling.

If it's possible to add passive listener when there is support for it: For something like this:

document.addEventListener('touchstart', onTouchStart, {passive: true});