Bug: Unable to delete the decrorate node in firefox
Lexical version: "lexical": "^0.12.2", "@lexical/react": "^0.12.2", Firefox version 120.0 Windows
Steps To Reproduce
1.Using Firefox, (In Chrome, it works as expected) 2.Insert an inline style decorateNode (can be a picture,an emoji ,etc ...) at the beggining of the first paragraph 3. hit BACKSPACE, you will find the decorateNode is still there,not deleted
The current behavior
after hitting the BACKSPACE, the decorateNode is still there
The expected behavior
after hitting the BACKSPACE, the decorateNode should gone
Have run into this issue as well in Lexical version: 0.14.5, Firefox and Chrome for Android.
Wondering if you've found any workaround, or a patch solution @cr7cr8?
This was fixed in v0.25.0 by #7155, which rewrote deleteCharacter to traverse the node tree directly via the caret API instead of relying on browser selection APIs. The old implementation used $getAdjacentNode + Selection.modify(), which resolved cursor positions differently in Firefox, causing it to miss the adjacent decorator as a deletion target.
Verified on current main — backspace correctly deletes an inline decorator at the start of a paragraph in Firefox.