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

Keyboard enhancements: Improve tabbing and focus in placeholder blocks #3016

Closed
jasmussen opened this issue Oct 13, 2017 · 2 comments
Closed
Assignees
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Enhancement A suggestion for improvement.

Comments

@jasmussen
Copy link
Contributor

In #2983 (comment) and #2983 (comment), potential future improvements to tabbing in blocks were discussed.

Briefly:

  • If your text cursor is not in a block, or you don't have any block selected, tabbing through the main content area simply highlights a block
  • Pressing Enter on a highlighted block selects it, which is the same as setting the text cursor inside a text block, clicking on an image to see the alignment controls, or clicking a button in a placeholder block

When a block is selected, you can still tab around the block for the movers and settings shortcuts. See also #3003.

We also have arrowkey navigation (see #2990) across blocks, which behaves/should behave like it would in any textfield. Combined with the slash command, you should be able to build an entire post, only using the keyboard, without having to tab anymore than you absolutely need to, if we make some enhancements. That's what this ticket is about. To explain, here are some flows today, and how we could improve them.

Inserting an image:

image-now

Can we change this so as soon as the image placeholder is inserted, the Upload button has focus, instead of requiring a tab as it does now?

Same with Cover Image:

cover iamge

Same with Custom HTML:

custom html

Also Classic Text:

classic

Compare this to headings, where pressing tab to set focus isn't necessary:

heading

@jasmussen jasmussen added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Enhancement A suggestion for improvement. labels Oct 13, 2017
@BoardJames
Copy link

The common element of the ones that focus right away is that they all use Editable.

Editable handles the focus prop by setting the selection to TinyMCE's remembered cursor position normally or at the end if focus.offset === -1.

In theory I could do the exact same fix for other blocks - just store the selected components in state and on focus set the selection to them unless offset or some other state would override that.

@mtias
Copy link
Member

mtias commented Nov 20, 2017

Closing as related to: #1829

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants