Smooth scrolling and touch responsiveness are critical for mobile web applications. A major cause of mobile scroll stutter (jank) is the browser's requirement to check whether an event listener calls event.preventDefault(). Passive Event Listeners eliminate this bottleneck, boosting scroll performance to 60 FPS.
1. The Scroll Delay Problem Explained
When a user places their finger on a mobile screen and swipes:
1
The browser dispatches a touchstart or touchmove event.
2
The browser does not know if your JavaScript will call event.preventDefault() (which halts scrolling).
3
Therefore, the browser must pause the main scrolling thread and wait for your JavaScript listener to finish executing!
4
Even a 50ms JavaScript delay produces noticeable scroll stutter and delays page motion.
On older mobile browsers, a 300ms delay occurred between a user tapping the screen and the click event firing (as the browser waited to see if the tap was a double-tap to zoom).