Web Development
Bug Report
Throttled scroll handler misses the last position: adding trailing calls in JavaScript
Our reading progress bar stopped at 92% and saved scroll positions were always slightly behind. A hand-written leading-edge throttle dropped the final scroll event of every gesture. We added a trailing call, tested it with fake timers, and compared requestAnimationFrame and scrollend.