-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Copy + pasting blocks inserts classic editor before and after the pasted element (On Windows only) #16369
Comments
What version are you using? I'm not able to reproduce the issue personally. |
Hi @youknowriad Exact steps I did:
Tested on Windows 10 in Firefox, Chrome and Edge with same behaviour. Hope that helps. |
@QuietNoise Are you converting to "header" or "heading"? Header block is not something that is available in Gutenberg Core. I just tried again in master with the heading block and I'm still not able to reproduce. I'm using Chrome but MacOS. Also, I wonder if it's specific to WordPress.com integration somehow? |
@youknowriad My bad. I meant the Heading block. We can then assume it's a Windows specific problem and that's why you can't see it. Maybe something to do with Ctrl key being pressed or with format of the clipboard on Windows. No idea. Wild guessing here. |
Interesting. Let's reopen and debug. Thanks for helping. Would you be able to share the content of the browser console, when you paste? |
cc @ellatrix weird windows pasting issue. Not sure if you know anything about that. |
Thanks a lot @QuietNoise It seems that the error might come from the extra |
There is definitely something to it. If I paste the clipboard HTML from Windows on a mac machine it will expose the bug behaviour. I.e. paste this in editor on mac:
The text will be treated as a plain text rather than HTML but the bug will appear regardless. |
Same issue WP 5.3... Any news about this? |
The issue seems to be the extra |
Output:
|
Describe the bug
If you copy / paste a block or multiple blocks within the editor the pasted version of the content will be wrapped with Classic block before and after.
To reproduce
Steps to reproduce the behaviour:
Select one or few blocks (Heading, Paragraph, Image) while editing content in the Editor and copy it clipboard (Ctrl + C)
Click anywhere else in the editable area of the page and paste the clipboard (Ctrl + V).
Observe two additional empty Classic blocks added, one at the start and one at the end of the pasted content
Expected behavior
I would expect the pasted content does not have any extra blocks to it.
This is especially an abhorrent issue when we know that Classic block does not work in Container blocks (Group, Columns) and irrecoverably breaks them as reported by numerous. (consolidated here #13187).
So, if you happen to paste your content into a Column or Group and you don’t deliberately delete the extra Classic blocks then the content in your Containers block will be screwed after you update the post and come back to editing it later.
Desktop (please complete the following information):
Tested on WP Version 5.2.2 (with Gutenberg deactivated as well as with Gutenberg 5.9.2 and with 6.0.0).
Tested on rather heavy customised sites as well as on fresh WP / Gutenberg installs.
Additional context
The copied blocks’ code doesn’t expose any ‘extras’ in them.
The issue is appearing when you paste the code.
I consider this a very serious issue.
Most of my clients are aware to not use the Classic editor in the container blocks as of now. This adds another level of hurdle to their CMS experience.
I went to investigate few sites and I did observe this bug breaking content across the realm of WP. Quite often people don't even realize that the page they published / updated will have un-editable parts in them when they return to edit screen at a later date.
The text was updated successfully, but these errors were encountered: