Android selection drag handle gets stuck #1675
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe the issue
When dragging the drag handle to select text, sometimes it gets "stuck" and can't be moved anymore. Seems to happen more often if you move the drag handle quickly.
https://github.com/user-attachments/assets/4b2c2a44-2f4d-4f3e-805f-91ec7c221dc0
Browser and platform
Android 16 / Chrome 145.0.7632.75
Reproduction link
https://codemirror.net/try/
I can reproduce this. It seems to be related to
highlightSelectionMatchescausing DOM changes around the selection (adding the wrapper nodes that do the highlighting), which somehow causes Chrome to decide the drag needs to be aborted. The only solution I was able to find was to turn offhighlightSelectionMatches.We're experiencing something similar (although not using highlightSelectionMatches) in Obsidian where selecting in a long document with heavy formatting causes the drag to be aborted almost every paragraph, which makes selecting large parts of the document really difficult. If I remember correctly we are already detecting that this drag has started and we stop making any decoration changes during a drag.
Do you have any suggestion on how we can isolate the cause on our side?
By 'isolate' you mean find out which decoration is triggering this? I guess you could turn off extensions one by one to see which one(s) affect this problem.
You're right, I should have thought of that. Will report back.
So far I've isolated the problem to multiple extensions. One of the offenders was an active line highlighter which added
.cm-activeto the currently selected line (which got updated as the selection changed).But even disabling it I found that just having block widgets in general will cause the issue to happen from time to time when the selection crosses over the block widget.
Repro link
https://github.com/user-attachments/assets/ca9250db-9b84-4afb-91da-dd5e828447af
Were you able to reproduce it with the block widgets? I can remove the line highlighter for Android, but I don't really have a good workaround for block widgets...
Nope. I tried to get
highlightSelectionMatchesto stop changing the DOM during selection, but it appears a script cannot even really detect that that is happening, since no touch events are fired for selection handle dragging.So I think all I can do here is call this a browser issue. You could try to set up a small script without CodeMirror that displays the problem, and report it to the Blink team.
Ah that's unfortunate. We internally were able to debounce on selection change to block all widget changes while the selection was rapidly changing, and flush later. This works for our active line highlighter widget, but it seems that selection still gets stuck on random occasions when crossing block widgets.