ProseMirror / prosemirror

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

Inline node with widget decoration text deletion behave weirdly #1337

Closed Hideman85 closed 1 year ago

Hideman85 commented 1 year ago

Hi,

First thank you a lot for this awesome library 🚀

Context, I'm using inline nodes and I'm using decorations, then I have a weird behavior on both FF and Chrome that is wrong in both when deleting. The inline has for content inline+ and the decoration is a widget for the test case that place to the selection.

  1. On chrome when deleting the last char of the inline, the inline remains with a br and the decoration. On FF the inline goes and the decoration is on the right place.
  2. Continuing deleting on FF delete the full inline instead of one char and chrome behave the same as 1.

Here is the video: Screencast from 2022-11-21 19-07-30.webm And here is the reproduction Glitch - index.js

System: Ubuntu 22.10 Browsers: FF 107 and chrome 107.0.5304.110

We tried on macos chrome and got the same issue.

marijnh commented 1 year ago

Inline nodes with content don't really have a standard behavior in this library because, as you found, browsers treat them differently and weirdly when it comes to native editing. See this discussion. If you really need to use inline nodes, rather than marks, you're going to have to script most user interaction with them directly via key bindings.