lexical icon indicating copy to clipboard operation
lexical copied to clipboard

Bug: Unable to delete the decrorate node in firefox

Open cr7cr8 opened this issue 3 years ago • 2 comments

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

cr7cr8 avatar Dec 01 '23 10:12 cr7cr8

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?

potatochriswd avatar Oct 08 '24 00:10 potatochriswd

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.

mayrang avatar Jul 13 '26 07:07 mayrang