Open 9larsons opened 1 year ago
In this case, when calling insertText('')
, the selected nodes are the text nodes and, ultimately, the child text node of the link node. The problem is that lastNode
uses the offset
used by the parentNode
(the paragraph), clipping the text. It should use the getTextContentLength()
value because it should be grabbing the entire node.
@9larsons I can't replicate this when testing with the fix in https://github.com/facebook/lexical/pull/5053 - can you confirm?
@kevinansfield agreed - the root cause is the same here. The fix you proposed to #5053 works for this as well.
Lexical version: v0.12.2
Steps To Reproduce
The current behavior
https://github.com/facebook/lexical/assets/21961100/dd8a95e4-f7f8-4aa3-8d2a-f3051a3b9234
The expected behavior
Delete all content in the paragraph.