-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Block: Consider changing focusable block wrapper from outer to inner #6687
Comments
I believe this is the current editor's behavior? I know it's not ideal, and I believe this is what Andrea hoped to solve with the unified "ctrl/cmd" command to enter the toolbar back in the day. Also an open question how, if any, the navigation mode that @youknowriad is working on might play into this. If for example you are in "isEditing mode" when you are typing, does that change the tab behavior? Probably not but worth mentioning. |
It's very unlikely users would expect that, as all the previous controls would be basically "skipped" and some users wouldn't have a clue they even exist. Also, visual order and tab order should always match.
From an accessibility perspective, it's the order that matters. If the editable content is the main content, then it should be placed as first element in the block keeping the native tab order. I'd warn against programmatically managing focus to assume a specific workflow. That would be just an assumption, while often users find several, different, unexpected, ways to use an UI. I understand the formatting toolbar at the top is useful for mouse users. However, other users have different needs. Mobile brings in new issues too. After several months we're using this UI, I'm starting to think there's no single solution able to address all users needs. I'd tend to think this is probably one of the cases where an option would make sense. See related #6224, #3976 (proposal to place the formatting toolbar below the block), #3961, #5694. |
Discussed during today's accessibility bug-scrub: @aduth is this still on the radar? We still tend to think the best option is to not play with focus and just try to get a natural tab order that makes sense. |
Since it's been some time since I've considered this, it's not clear upon revisiting what precisely should be done here. |
See also #12648 with some considerations about initial focus and nested blocks. Noting a clear pattern for the blocks initial focus still needs to be addressed. It's challenging because of the different interaction across different blocks and because the block UI controls order is not ideal. It's a broad issue that would probably need some dedicated meeting 🙂 |
I believe this should be closed now since we only have a single wrapper. |
Previously: #5102 (comment)
Currently the block's focusable wrapper is the top-level (root) element of
block-list/block.js
:gutenberg/editor/components/block-list/block.js
Lines 480 to 498 in 2b76039
This element includes as descendents both the UI of a block (its movers, toolbar, menu) and the editable form of the block itself. The impact here is that when a block wrapper is focused (e.g. when no other text inputs exist as in a newly inserted image placeholder block), the user must tab through all of the movers, toolbar buttons, and menu before reaching the content of the block itself.
It's been proposed that instead the first tab should transition focus into the block's editable form, and that Shift-Tab would reverse navigate through focusable items in the surrounding UI:
In implementation, this would be represented by changing the focusable wrapper to the
IgnoreNestedEvents
element immediately wrapping the block editable form:gutenberg/editor/components/block-list/block.js
Lines 544 to 551 in 2b76039
Open questions:
Whichever behavior is decided upon should be reflected with end-to-end tests verifying the expectations.
cc @jasmussen @afercia
The text was updated successfully, but these errors were encountered: