Skip to content

Heading unexpectedly loses formatting when copy and pasting #48040

Description

@danielbachhuber

Description

When I copy and paste a heading, the heading loses its formatting:

CleanShot.2023-02-13.at.09.29.20.mp4

Step-by-step reproduction instructions

  1. Create a new post.
  2. Add a heading.
  3. Copy the heading.
  4. Paste the heading.
  5. Observe that your pasted heading doesn't contain the expected format.

Screenshots, screen recording, code snippet

No response

Environment info

  • Reproduces in both Firefox 109.0.1 and Chrome 110.0.5481.77 on Mac
  • Gutenberg 15.1.0

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Activity

  1. richtabor commented on Feb 13, 2023

    @richtabor
    Member

    Came here to report this as well.

  2. added
    [Type] Bug
    on Feb 14, 2023
  3. added
    [Priority] High
    on Feb 14, 2023
  4. ellatrix commented on Feb 20, 2023

    @ellatrix
    Member

    With formatting, you mean the heading element?

    Could you share what's logged in the console? I'm trying this in Chrome and what the browser is giving us in the clipboard is text without the heading, so we just look at that.

    Is this a regression? Did it not always behave like this?

  5. danielbachhuber commented on Feb 20, 2023

    @danielbachhuber
    MemberAuthor

    With formatting, you mean the heading element?

    @ellatrix Yes.

    Could you share what's logged in the console? I'm trying this in Chrome and what the browser is giving us in the clipboard is text without the heading, so we just look at that.

    CleanShot.2023-02-20.at.04.39.39.mp4

    Is this a regression? Did it not always behave like this?

    Yes, it's a regression.

    Interestingly, 'Copy block' seems to work fine:

    CleanShot.2023-02-20.at.04.43.23.mp4

    Maybe something changed about what the browser sees as selected?

  6. ndiego commented on Feb 20, 2023

    @ndiego
    Member

    @danielbachhuber I was just testing this in WordPress 6.1.1 without Gutenberg, and the behavior appears to be the same. So while I agree that this is not the ideal behavior, I am not sure it's actually a regression. Would you be able to confirm on your end?

    I'm just trying to whittle down the "Todos" for 6.2 as we prep for Beta 3, so if this is not a regression between 6.1 and 6.2, I recommend we punt to 6.3. Thanks!

  7. danielbachhuber commented on Feb 20, 2023

    @danielbachhuber
    MemberAuthor

    I was just testing this in WordPress 6.1.1 without Gutenberg, and the behavior appears to be the same.

    @ndiego I can confirm the same error occurs in WordPress 6.1.1.

    So while I agree that this is not the ideal behavior, I am not sure it's actually a regression. [...] I'm just trying to whittle down the "Todos" for 6.2 as we prep for Beta 3, so if this is not a regression between 6.1 and 6.2, I recommend we punt to 6.3.

    Regardless of the semantics, it seems like a pretty glaring bug to leave unfixed for a full cycle.

  8. ndiego commented on Feb 20, 2023

    @ndiego
    Member

    Regardless of the semantics, it seems like a pretty glaring bug to leave unfixed for a full cycle.

    100% agree, it would be great to get it fixed in time. I'm just concerned with the amount of other issues currently on the board. It does appear that this issue has existed at least as far back as 5.9. cc @annezazu

  9. danielbachhuber commented on Feb 20, 2023

    @danielbachhuber
    MemberAuthor

    It does appear that this issue has existed at least as far back as 5.9.

    @ndiego It stopped working more recently than 5.9, so maybe it's a change in browser behavior?

  10. added
    [Status] In Progress
    on Feb 20, 2023
  11. moved this from 📥 Todo to 🏗️ In Progress in WordPress 6.2 Editor Taskson Feb 23, 2023
  12. moved this from 🏗️ In Progress to 🦵 Punted to 6.3 in WordPress 6.2 Editor Taskson Mar 20, 2023
  13. 36 remaining items

  14. ellatrix commented on Nov 23, 2023

    @ellatrix
    Member

    It was reverted

  15. moved this from Needs review to Needs development in Polishon Dec 19, 2023
  16. moved this to 🗣️ In Discussion / Needs Decision in WordPress 6.5 Editor Taskson Jan 5, 2024
  17. moved this from 🗣️ In Discussion / Needs Decision to 🦵 Punted to 6.6 in WordPress 6.5 Editor Taskson Jan 24, 2024
  18. annezazu commented on Jan 24, 2024

    @annezazu
    Contributor

    Punting this as no work has been done and we're closing in on crunch time for beta 1 for 6.5.

  19. colorful-tones commented on May 22, 2024

    @colorful-tones
    Member

    Hi folks,
    We are only one week away from the Beta 1 cut-off date for WordPress 6.6. This issue hasn’t seen any movement in a while, so we (the editor triage leads of the 6.6 release) have decided to remove it from the WordPress 6.6 Editor Tasks project board.

  20. added
    [Block] Heading
    on Jul 9, 2024
  21. added
    [Status] In Progress
    on Jul 30, 2026
  22. moved this from Needs development to Done in Polishon Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Needs Dev[Block] Heading[Feature] Paste[Priority] High[Status] In Progress[Type] Bug

Type

No type

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions