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

Cut and paste list item into a new block creates an invalid paragraph block #32467

Closed
bobbingwide opened this issue Jun 4, 2021 · 5 comments
Closed
Labels
[Feature] Paste [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable [Type] Bug An existing feature does not function as intended

Comments

@bobbingwide
Copy link
Contributor

Description

I was trying to cut and paste list items from one list to another. After saving and reediting the new list items were broken.

Step-by-step reproduction instructions

  1. Create a post with a list block with multiple list items.
  2. Select a list item and copy it to the clipboard
  3. Delete the selected item
  4. Paste the clipboard content into the post
  5. Save
  6. View
  7. Edit
  8. The newly created block in step 4 is now broken
  9. Attempt block recovery loses the list item's text.

Expected behaviour

When the list item is pasted then it should become a list block.

Actual behaviour

When the list item is pasted it becomes a list item in a paragraph block.

<!-- wp:paragraph -->
<p> <li>What is silver side reindeering?</li>  </p>
<!-- /wp:paragraph -->

Screenshots or screen recording (optional)

result after step 7.
image

result after step 4. having gone back to step 2. to try again.
This shows the list item being created in a paragraph block.
image

Code snippet (optional)

WordPress information

  • WordPress version: 5.7.2
  • Gutenberg version: 10.7.1
  • Are all plugins except Gutenberg deactivated? No
  • Are you using a default theme (e.g. Twenty Twenty-One)? No

Device information

  • Device: Desktopn
  • Operating system: Windows 10
  • Browser: Chrome
@bobbingwide
Copy link
Contributor Author

For a demonstration of the problem plus a few other feechurs of the list block and block transforms see this video
https://youtu.be/FMe-pNfP4HQ

@Mamaduka Mamaduka added the [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable label Jun 9, 2021
@skorasaurus
Copy link
Member

skorasaurus commented Jun 25, 2021

I'm able to reproduce this; compiled from Gutenberg trunk earlier today (2021-06-30);
notably, if you cut the list item instead of copy; text will transform into a paragraph (without any list formatting) upon paste.

(sorry if you mention this in the video, i did not watch it).

@skorasaurus skorasaurus added the [Type] Bug An existing feature does not function as intended label Jun 25, 2021
@skorasaurus
Copy link
Member

very similar examples of this cropping up recently:
#32467
#32980
#31067

@pbiron
Copy link

pbiron commented Jul 16, 2021

Similar (and probably related), in 5.8-RC4:

  1. copy a list item to the clipboard
  2. insert a heading block somewhere else
  3. paste the clipboard into the heading block

That results in an empty heading block and a new list block, although neither block is "broken").

@annezazu
Copy link
Contributor

I tried replicating this with 6.3 RC1 but was unable to. Closing this out but opening a new issue around the copy/paste experience with the new list block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Paste [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

5 participants