The editor is rendered within a web component shadow root.
On the screenshot you can see that if the dragged text is between 2 lines, the cursor (yellow) will jump at the end of the block.
This happens only on Chrome (Chromium 111.0.5563.64 (Build officiel) snap (64 bits) on Ubuntu) not Firefox.
This doesn't happen in Prosemirror demo (https://glitch.com/edit/#!/remix/prosemirror-demo-basic) hence the strong suspicion that it comes from the Shadow Root.
This is visible while drag and dropping, however the root issue seems to be in "prosemirror-view" posAtCoords method, which returns a position at the end of the block. If I hover text and not blank space, the cursor is back to normal, leading to visual jumps during drag and unreliable drag and drop experience.
Chrome's caretRangeFromPoint is broken in shadow roots, and the editor's own replacement implementation didn't handle this situation well. Attached patch should help.
The editor is rendered within a web component shadow root.
On the screenshot you can see that if the dragged text is between 2 lines, the cursor (yellow) will jump at the end of the block.
This happens only on Chrome (Chromium 111.0.5563.64 (Build officiel) snap (64 bits) on Ubuntu) not Firefox. This doesn't happen in Prosemirror demo (https://glitch.com/edit/#!/remix/prosemirror-demo-basic) hence the strong suspicion that it comes from the Shadow Root.
This is visible while drag and dropping, however the root issue seems to be in "prosemirror-view"
posAtCoords
method, which returns a position at the end of the block. If I hover text and not blank space, the cursor is back to normal, leading to visual jumps during drag and unreliable drag and drop experience.I've managed to build a repro: https://insidious-therapeutic-point.glitch.me/