Users reported laggy scrolling on Android after a recent Discourse update, affecting both mobile and desktop views, PWA, and browser. Don first identified the issue on a Huawei P20 Pro running Android 10 and Chrome 96, noting delayed scroll response after touch. david initially suspected a recent commit related to passive event listeners but found it didn’t resolve the issue — even after testing a theme that removed those listeners Don. Falco couldn’t reproduce the issue, but Osama confirmed it on a Pixel 4 XL with Android 12, especially noticeable during short, repeated scrolls. david then deployed a fix 4d3eb3f1ac that improved performance, which Don confirmed resolved the lag. david later realized the root cause was a separate commit 1166afa4e8 that refactored --header-offset logic to run continuously, slowing scroll. The fix optimized that logic, restoring smooth scrolling.
This is very interesting, thanks for reporting! As far as I’m aware, the only recent commit which affects scrolling would be:
But if anything, I would have expected that to make scrolling smoother, not worse! (I switched this particular feature to use ‘passive’ event listeners, rather than blocking event listeners)
As an experiment, I just made a theme here on Meta which removes those updated event listeners. https://meta.discourse.org/?preview_theme_id=260 (Named “Experiment - remove scroll listener” in the hamburger) Does this theme fix the lagging for you?
I can repro here on Meta using my Pixel 4 XL running Android 12. I didn’t notice it until I read this topic. The best way to see it is to scroll short distances (~2cm on the screen) repeatedly.
Oh yes, you’re absolutely right! I totally missed that. This commit from yesterday refactored the --header-offset logic so that it runs all the time, rather than ‘only when docked’. That slowed down scroll performance. My fix made that logic more efficient, so that’s why it’s working now.