Skip to content
This repository was archived by the owner on Apr 15, 2026. It is now read-only.
This repository was archived by the owner on Apr 15, 2026. It is now read-only.

Android selection drag handle gets stuck #1675

Open

Description

@lishid

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.

Screen_Recording_20260215_155449_Chrome.mp4

Browser and platform

Android 16 / Chrome 145.0.7632.75

Reproduction link

https://codemirror.net/try/

Activity

  1. marijnh commented on Feb 16, 2026

    @marijnh
    Member

    I can reproduce this. It seems to be related to highlightSelectionMatches causing 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 off highlightSelectionMatches.

  2. lishid commented on Feb 16, 2026

    @lishid
    Author

    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?

  3. marijnh commented on Feb 16, 2026

    @marijnh
    Member

    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.

  4. lishid commented on Feb 16, 2026

    @lishid
    Author

    You're right, I should have thought of that. Will report back.

  5. lishid commented on Feb 16, 2026

    @lishid
    Author

    So far I've isolated the problem to multiple extensions. One of the offenders was an active line highlighter which added .cm-active to 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

    Screen_Recording_20260216_125809_Chrome.mp4
  6. lishid commented on Feb 19, 2026

    @lishid
    Author

    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...

  7. marijnh commented on Feb 19, 2026

    @marijnh
    Member

    Nope. I tried to get highlightSelectionMatches to 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.

  8. lishid commented on Feb 19, 2026

    @lishid
    Author

    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.

  9. marijnh commented on Apr 15, 2026

    @marijnh
    Member

    This issue has been moved to issue #1675 on the repository's new home.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions