Closed mayacoda closed 2 months ago
What appears to be happening is that Firefox, for some reason, inserts a nonsense <br>
node into the parent <li>
item when you do this. ProseMirror then parses this, since <br>
are inline content, as a newly created separate paragraph, and, since the text insertion created a new paragraph, it treats it as enter-equivalent.
Attached patch adds a kludge to detect this situation and drop the stray <br>
node.
When pressing backspace at the end of a list item that has an inline, unselectable atom node followed by a text node with a single character, trying to delete that character with Backspace triggers a keydown event with Enter instead.
This only happens in Firefox. It's not clear in the video, but I am pressing Backspace.
https://github.com/ProseMirror/prosemirror/assets/6614995/6562715d-9fbc-4cf5-a094-c992f9ecb978
Reproducible demo with code: https://glitch.com/edit/#!/candy-dazzling-spoonbill
I was able to track down the cause, it appears that the second part of this condition in
readDOMChange
returns a false positive, hence why the Enter event is triggered instead.