-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Pasting over content starting with an empty node appends instead of replace #6763
Comments
I believe it has to do with this function. lexical/packages/lexical/src/LexicalSelection.ts Lines 1334 to 1341 in 409c65e
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.
Screen.Recording.2024-10-25.at.9.18.08.AM.mov
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.
The text was updated successfully, but these errors were encountered: