Open orelbn opened 1 month ago
I believe it has to do with this function.
I tried to figure it out myself, but the function's assumptions in the third case are unclear to me.
@trueadm hey, I'd like to contribute to this one. Mind assigning?
@hunxjunedo there's no need for assignment, when/if you have a solution then you can submit a PR
Pasting over content that starts with an empty node leads to appending instead of replacement.
https://github.com/user-attachments/assets/9ed8bd65-6a1e-4312-979f-f5635a7691a8
Lexical version: 0.18.1+dev.esm
Steps To Reproduce
The current behavior
Appends to the selected content instead of replacing it on paste
The expected behavior
The text that is selected should replaced not append to.
Impact of fix
Pasting content is pretty fundamental to a text editor. This behaviour can lead to weird behaviours for all users.