Scrolling issues on latest Google Chrome

Hello there folks,

I was concerned about reporting this through Github issues as I have a feeling this is not a bug on Codemirror, but perhaps some required adaptation due to changes (or bug) on Google Chrome’s latest release.

My shader editor ( https://thecodetherapy.com ), as much as some very popular projects like ShaderToy ( https://www.shadertoy.com/ ) uses Codemirror, and I noticed that after the latest Google Chrome update, the inner contents of the editor only scroll a small amount and then scrolling stops. However, I noticed that if you keep the mouse cursor moving all the time, the scroll never gets interrupted and works as intended.

The issue is more easily noticeable when accessing some long content ( as in: The 80s On ASCIID @ TheCodeTherapy on PRGM1 tab). On Firefox everything keeps working as expected.

I’m presuming this is somehow related to some changes in Google Chrome in regards to the way event listeners work (maybe a Google Chrome bug or an intended change) and unfortunately, I couldn’t find anything in their release notes to help me understand where to start investigating this issue.

If anyone could point me to a most probable cause for this so I can dig further trying to “fix” this, it would be highly appreciated.

*EDIT 1: This issue is also noticeable on Codemirror examples, like this one: CodeMirror: Sublime Text bindings demo Steps to reproduce are: 1) copy some lines inside the bindings object and paste them over and over again to make the content big enough for the issue to be noticeable; 2) try to scroll through the content without moving the mouse pointer (scroll will stop working); 3) when the scroll stops working, try doing the same while constantly moving the mouse pointer (scroll will keep working as expected);

*EDIT 2: I could find no warnings or errors on the browser’s console.

My Chrome version: Version 102.0.5005.61 (Official Build) (64-bit) on Linux

Kindest regards,

Marco.

I can reproduce this on Linux. The editor isn’t messing with the wheel events, and the events themselves look fine … the browser just stops scrolling as soon as the editor draws new content to move the virtual viewport. This does indeed seem like a Chrome regression, and will probably also impact other software that does viewporting based on the scroll position. I don’t have time to look into this today, but I’ll try to make sure this is reported to the Chrome team and see if I can figure out a workaround until they fix it. It also affects CodeMirror 6, and they broke their own devtools with this, so it’s kind of surprising no one noticed before the release.

The patch below should help, until the Chrome team fixes this properly.

1 Like