ProseMirror / prosemirror

The ProseMirror WYSIWYM editor
http://prosemirror.net/
MIT License
7.74k stars 336 forks source link

Cannot select inline atom nodes at the start of a paragraph #1199

Open pmairoldi opened 3 years ago

pmairoldi commented 3 years ago

Issue details

I created a node that is inline and atom with no content. When I try to drag a selection with the mouse, the selection gets stuck and never selects the the first node when starting at the end of the paragraph. The opposite happens when starting at the beginning, the first node is selected but it can never go past that. When using the keyboard everything works fine.

Steps to reproduce

To reproduce the issue, insert 3 of these node one after each other inside a paragraph and then try to drag a selection across them. Here is a screencast showing that (https://recordit.co/4dAmRKpzPm).

A project reproducing the issue can be found here (https://stackblitz.com/edit/prosemirror-drag-drop-bug-simple-nygz6s?file=index.js)

ProseMirror version

prosemirror-view: 1.19.3

Affected platforms

marijnh commented 3 years ago

For me (Chrome 90) selecting right-to-left seems to work. But left-to-right indeed doesn't (for me it stops after the first node). The same issue occurs in plain contenteditable elements with a similar structure—Chrome just refuses to move the DOM selection beyond the first element—and I haven't been able to find a workaround for that. Filing an issue on https://bugs.chromium.org/ might be worthwhile.