Heading block: toggling heading level alternates between displaying content and placeholder label
Description
Toggling the heading level of a Heading block containing content will alternate between the content and the block's placeholder label.
Step-by-step reproduction instructions
- Add a Heading block.
- Add some text.
- Change the heading level via the block toolbar and observe the text is replaced by a placeholder label for the block.
- Change back to the initial level and observe the text reappears.
Expected behaviour
Text entered into the Heading block should persist when the level is changed.
Actual behaviour
Changing to a different heading level after text has been entered reverts to showing the block's placeholder label. Changing back to the initial heading level returns the user-entered text.
Screenshots or screen recording (optional)

WordPress information
- WordPress version: 5.8-beta1
- Gutenberg version: 10.8
- Are all plugins except Gutenberg deactivated? Yes
- Are you using a default theme (e.g. Twenty Twenty-One)? TT1 Blocks
Device information
- Device: Desktop
- Operating system: Windows 10
- Browser: Chrome 91.0.4472.106
mmm 🤔 I'm not able to reproduce this personally. Anything specific about your install?
@youknowriad, thanks for taking a look.
I don't think there's anything unique about the install, it's a simple test site with only Gutenberg active. When I have Gutenberg deactivated changing levels works as expected.
- The theme in the screenshot is TT1 Blocks but I first experienced this with a different theme active.
- Have tested with a fresh install of WordPress and Gutenberg.
- There's a few Chrome violation notices but no errors in the console.
This does feel like the type of issue that would be easily replicated so I'm going to presume it's something unknown at my end. I'll close this for now and add an update if I work out why I'm seeing this.
Thanks for following up, indeed it sounds intriguing.
There's a few Chrome violation notices but no errors in the console.
What kind of chrome violation?
I should also clarify that I'm not testing on Windows, so that could be a factor, would be good to get more folks testing this as well.
Here's the Chrome violation notices I see when inserting the Heading block, adding content and switching levels:
[Violation] 'keydown' handler took 153ms index.js?ver=3dca987…36a0a9b5e818474df:1
[Violation] 'input' handler took 250ms index.js?ver=07cd2ee…e490bc9bb6cf04bd:44
[Violation] Added non-passive event listener to a scroll-blocking 'wheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952 index.js?ver=07cd2ee…e490bc9bb6cf04bd:44
[Violation] Added non-passive event listener to a scroll-blocking 'wheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952 index.js?ver=07cd2ee…e490bc9bb6cf04bd:81
[Violation] 'mousemove' handler took 185ms index.js?ver=07cd2ee…e490bc9bb6cf04bd:44 [Violation] Added non-passive event listener to a scroll-blocking 'wheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952 index.js?ver=07cd2ee…e490bc9bb6cf04bd:44
[Violation] Added non-passive event listener to a scroll-blocking 'wheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952 index.js?ver=07cd2ee…e490bc9bb6cf04bd:44 [Violation] 'mousemove' handler took 152ms index.js?ver=07cd2ee…e490bc9bb6cf04bd:44
[Violation] Added non-passive event listener to a scroll-blocking 'wheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
[Violation] 'click' handler took 239ms index.js?ver=07cd2ee…e490bc9bb6cf04bd:44
[Violation] Added non-passive event listener to a scroll-blocking 'wheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952 index.js?ver=07cd2ee…e490bc9bb6cf04bd:44
[Violation] 'mousemove' handler took 179ms lodash.min.js?ver=4.17.19:88
[Violation] 'setTimeout' handler took 117ms index.js?ver=07cd2ee…e490bc9bb6cf04bd:44
[Violation] Added non-passive event listener to a scroll-blocking 'wheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952 index.js?ver=07cd2ee…e490bc9bb6cf04bd:44
[Violation] 'mousemove' handler took 157ms
Seems related: https://github.com/WordPress/gutenberg/issues/32753
I think this got fixed via #32432.
I can reproduce the issue with Gutenberg 10.8.2, but not with 10.9.0-RC or the current trunk.
That explains it I guess :)