ProseMirror / prosemirror

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

Bug: Safari visual selection bug with custom nodes #1462

Open HalfdanJ opened 2 months ago

HalfdanJ commented 2 months ago

When working with custom nodes, there is a bug in safari where too much text is shown as selected. It happens when a selection range starts at a custom node, when that happens the selection is shown as expanded to the beginning of the paragraph.

Steps to reproduce

Safari version: 17.4.1

This works fine in chrome.

https://github.com/ProseMirror/prosemirror/assets/227529/e41958b7-ffc7-40c8-bd34-1bcb7be49ce2

Note that even though the selection is shown as starting at the beginning of the paragraph, its not actually selected.

I've noticed that this bug is also visible in apps in production, for example Linear:

https://github.com/ProseMirror/prosemirror/assets/227529/88e5a49f-8e18-4407-a240-376afa032f9f

Maybe related to https://github.com/ProseMirror/prosemirror/issues/1165 ?