Skip to content
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

Pasting multiple lines into a list creates a new text block and wipes out undo buffer #10042

Closed
codebykat opened this issue Sep 19, 2018 · 3 comments
Labels
[Block] List Affects the List Block [Feature] Paste [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed [Type] Bug An existing feature does not function as intended

Comments

@codebykat
Copy link
Contributor

Describe the bug
Pasting multi-line text into a list block splits the block into two blocks, with a text block in the middle. Worse, it also wipes out the undo buffer -- if you hit cmd+Z after this happens, the entire second part of the list gets deleted.

This is similar to #9476, but not quite the same issue.

To Reproduce
Steps to reproduce the behavior:

  1. Start a new post
  2. Create a list with several items
  3. Position the cursor at the end of one of the middle items
  4. Paste text that includes a line break
  5. Note that multiple blocks now exist
  6. Use cmd+Z to undo
  7. Note that half of your original list has vanished into the ether

Expected behavior

  1. Pasting multiple lines into a list should create more than one list item. Ideally if it's pasted at the end of an existing list item, the first line of the pasted text should be appended to the existing item, and subsequent lines should become their own list items, within the same block.
  2. Undo after a paste should work without losing content.

Screenshots
Here's a gif in which I run through the above steps (pasting multi-line text and then hitting undo):
listpaste

Desktop (please complete the following information):

  • OS: OSX High Sierra
  • Browser: Firefox 62
  • Gutenberg version: 3.8.0
@codebykat codebykat added the [Type] Bug An existing feature does not function as intended label Sep 19, 2018
@mcsf mcsf added [Feature] Paste [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... labels Sep 20, 2018
@mcsf
Copy link
Contributor

mcsf commented Sep 20, 2018

Oof, the content loss concerns me. Thanks for the report, Kat. /cc @iseulde

@mcsf mcsf added the [Priority] High Used to indicate top priority items that need quick attention label Sep 20, 2018
@mcsf
Copy link
Contributor

mcsf commented Sep 20, 2018

OK, so there isn't real content loss, but rather too many undo levels are added: if you keep pressing Undo, you'll retrace the editor's steps back to before pasting.

@mtias mtias removed the [Priority] High Used to indicate top priority items that need quick attention label Oct 7, 2018
@ellatrix ellatrix added the [Block] List Affects the List Block label Oct 16, 2018
@ellatrix
Copy link
Member

Duplicate of #8882.

@designsimply designsimply added the [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed label Dec 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] List Affects the List Block [Feature] Paste [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

5 participants