lexical icon indicating copy to clipboard operation
lexical copied to clipboard

Bug: Copy-paste doesn't work correctly with line break.

Open bigtimecriminal opened this issue 4 years ago • 4 comments

Copy-pasting text containing line-break nodes will cause text to insert incorrectly.

Lexical version: v0.6

Steps To Reproduce

  1. Copy the following text and paste into the playground: This is the first line.
    And this is the second line.
    And this is the third line.

  2. Select the second line by double clicking on it.

  3. Copy.

  4. Click on the end of the first line to move the caret there.

  5. Hit enter to create a new line.

  6. Paste.

The current behavior

Text is pasted at the end of the document.

https://user-images.githubusercontent.com/6975606/199627667-ff544948-dd55-4ddf-89d7-323aa408ab18.mov

The expected behavior

Text is pasted where the caret is.

bigtimecriminal avatar Nov 03 '22 00:11 bigtimecriminal

I'm unable to reproduce this bug. Can you confirm this on your side too?

trueadm avatar Nov 23 '22 14:11 trueadm

Yes, can be reproduced in the playground following the steps.

bigtimecriminal avatar Nov 23 '22 17:11 bigtimecriminal

Are you trying on https://playground.lexical.dev/? Also what OS/Browser are you using?

trueadm avatar Nov 23 '22 17:11 trueadm

Yes. Chrome 107, Mac OS.

bigtimecriminal avatar Nov 23 '22 21:11 bigtimecriminal