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

Paragraphs should be converted to headings using existing keyboard shortcuts #11173

Closed
cameronjonesweb opened this issue Oct 28, 2018 · 6 comments · Fixed by #44681
Closed

Paragraphs should be converted to headings using existing keyboard shortcuts #11173

cameronjonesweb opened this issue Oct 28, 2018 · 6 comments · Fixed by #44681
Assignees
Labels
[Block] Heading Affects the Headings Block [Block] Paragraph Affects the Paragraph Block [Package] Keyboard Shortcuts /packages/keyboard-shortcuts [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@cameronjonesweb
Copy link
Contributor

cameronjonesweb commented Oct 28, 2018

Describe the bug
Keyboard and formatting shortcuts that exist in the "classic" editor that convert paragraphs to headings should also apply to the paragraph block.

To Reproduce

  1. Create a paragraph block
  2. Press ALT + SHIFT + a number 1-6

or

  1. Create a paragraph block
  2. Start typing a number of hashes before the paragraph content
  3. Press enter/return

Expected behavior
The paragraph block should be converted to a heading block with the heading level matching the number of the key pressed or the number of hashes that preface the paragraph

Additional context

@rleeson
Copy link

rleeson commented Oct 28, 2018

Confirmed functionality does not meet the Keyboard Shortcuts outlined in the WordPress Codex.

Note, implementation requires transforming from the Paragraph block type to the Heading block type.

Confirmed with

  • Gutenberg 4.1.1 (only enabled plugin)
  • WordPress 4.9.8

@earnjam earnjam added the [Type] Enhancement A suggestion for improvement. label Oct 28, 2018
@cameronjonesweb
Copy link
Contributor Author

cameronjonesweb commented Nov 13, 2018

Latest version (4.3) has added the hashes markdown shortcut

@afercia
Copy link
Contributor

afercia commented Aug 29, 2020

This was recently reported also on Trac, see: https://core.trac.wordpress.org/ticket/51089

The accessibility team discussed this issue during the latest weekly meeting on Slack and agreed implementing the keyboard shortcuts to change heading levels that are available in the Classic Editor would be a good improvement, also considering feature parity. To recap:

control option 1 --> <h1> heading
control option 2 --> <h2> heading
control option 3 --> <h3> heading
control option 4 --> <h4> heading
control option 5 --> <h5> heading
control option 6 --> <h6> heading
control option 7 --> paragraph element

Regarding screen readers, worth reminding all the keyboard shortcuts that use control + option as modifier don't work with VoiceOver on masOS, as they conflict with native VoiceOver shortcuts. See https://core.trac.wordpress.org/ticket/39271, #11154 and the related #3218 which is the only way to solve conflicts.

@mtias
Copy link
Member

mtias commented Aug 30, 2020

@ellatrix we discussed this before and I remembered you had some concerns. What do you think of supporting them?

@mtias mtias added [Package] Keyboard Shortcuts /packages/keyboard-shortcuts [Block] Heading Affects the Headings Block [Block] Paragraph Affects the Paragraph Block labels Aug 30, 2020
@ellatrix
Copy link
Member

ellatrix commented Sep 8, 2020

ALT+SHIFT is not a good combo as it can produce input. CTRL+OPTION seems ok, if it doesn't clash with browser shortcuts.

@aristath
Copy link
Member

aristath commented Sep 9, 2020

ALT+SHIFT is not a good combo as it can produce input. CTRL+OPTION seems ok, if it doesn't clash with browser shortcuts.

+1 on that. Alt+Shift is used by many to switch keyboard locales

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Heading Affects the Headings Block [Block] Paragraph Affects the Paragraph Block [Package] Keyboard Shortcuts /packages/keyboard-shortcuts [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants