Scrolling while selecting with mouse stops until pointer moves

When selecting with the mouse, moving the cursor above or below the editor boundary scrolls the editor a bit, as you’d expect, but scrolling then stops. It only starts again when you wiggle the mouse, and then stops again. In other applications, scrolling is continuous.

This video illustrates this:


This patch should improve this.

1 Like

Thank you, as always.

It seems that “drag selection to scroll” works nicely in Firefox, but not in Chrome, as this demo illustrates.

Would it be possible for CodeMirror to do anything about this?

It would also be useful if the fix above could be extended to scroll the viewport when the mouse is just inside the edge of the editor, so “drag selection to scroll” works when the editor touches the top and/or bottom of the window (as in this sandbox).

That seems to be related to the iframe—I don’t see this problem in an editor that’s not inside a frame.

(Edit: link works fine in my Chrome Linux. Maybe a platform-specific issue?)

That’s certainly possible. I’m using Chrome on macOS, with the window at the bottom of the screen so the pointer can’t go below it.

Does this patch work for you?

It does!

I wonder if the base speed should be increased - or made configurable - as it’s arguably more convenient to drag-scroll the selection down slightly past the target destination (with the pointer at the bottom of the editor/window/screen) then move the selection head back up than it is to wait for the viewport to scroll slowly downwards. This is a great improvement, though - thank you.