Heading level keyboard shortcuts only work for Heading -> Paragraph transform and vice-versa #60567
Labels
[Block] Comments Title
Affects the Comments Title Block
[Block] Heading
Affects the Headings Block
[Block] Paragraph
Affects the Paragraph Block
[Block] Post Title
Affects the Post Title Block
[Block] Query Title
Affects the Query Title Block
[Block] Site Tagline
Affects the Site Tagline Block
[Block] Site Title
Affects the Site Title Block
[Feature] Block Transforms
Block transforms from one block to another
[Package] Block library
/packages/block-library
[Type] Bug
An existing feature does not function as intended
Description
Splitting this out from #60548
See also #30549
As an user, wherever I see the heading levels dropdown menu I'd expect the keyboard shortcuts to set the heading level to work. That's not the case, as they work only for the Heading and paragraph block.
However, the
HeadingLevelDropdown
component is used in other blocks as well, for example:Some of the dropdown menus of these blocks so provide the 'Paragraph' option, which internally works as a 'level 0', and some don't. Screenshots:
Site Tittle, Post Title, Heading:
Site Tagline, Query loop Post tempalte Title, Comments title:
In all these cases I would expect the kyboard shortcuts to work.
However, the shortcuts implementation is strictly tied with the block transform feature. It only works for Heading and Paragraph. In fact, all the other blocks don't use a transform, they just render the HTML tag conditionally.
Overall, I'd think this issue is broader than what it appears at first sight. I'd think it needs to reconsider the block transforms, variation transforms, HTML element used for rendering especially in terms of how they are presented to users.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
Environment info
No response
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
The text was updated successfully, but these errors were encountered: