-
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
Unexpected reverse-tab behaviour #1934
Comments
I think this is due to the nature of tabbing but I agree it doesn't make sense to a user. @afercia is there any way this could be negotiated and still be accessible? |
It's a bit more complex. At the moment, the Gutenberg blocks have different behaviors. Some blocks have two focusable containers, while other blocks have just one. Also, I see a different behavior between Chrome and Firefox, where on Firefox sometimes blocks don't get focused. Not sure trying to manage focus in this way is a good idea in the first place. Let's compare, for example, a text block with an image block. Tabbing forwards in Chrome:
Tabbing forwards in Firefox:
Tabbing backwards in Chrome:
Tabbing backwards in Firefox:
Sorry if it's a bit TL;DR 🙂 and I may have missed something. Worth noting these behaviors change if you change tabbing direction while you're on a block. I've noticed also some inconsistencies, difficult to describe. And I haven't tested in depth other blocks or other browsers (I wonder what might happen on IE 11 😱 ) The whole point, in my opinion, is that focus management as it is now is highly confusing and inefficient. However, before attempting any coding, making a decision about how focus should behave would be highly recommended. Easy, quick, and consistent navigation with the keyboard in both direction is key. I've seen some initial feedback from users who reported there are way too many tab stops. I'd tend to agree. Reducing the amount of tab stops is the first thing I'd consider. In this regard, making the toolbars real ARIA toolbar, with the expected keyboard interaction, could be an option. See #632 and https://www.w3.org/TR/wai-aria-practices/#toolbar One more thing I'd recommend is to review the hide/show mechanism of the toolbars. #552 (Pressing cmd/ctrl as a way to navigate into block toolbars) could help. One more very important consideration: focusing the outer container is really important because it's the only element that uses an |
The current editor allows easy navigation through your content using the cursor keys alone, I believe that any move away from this using other keys is a regression from the current 'distraction free writing' ethos and we really need to think about hopping to the next block up (if one exists) using the up cursor button if you are already at the top of the current block. vice versa using the down cursor key to hop to the next block (provided you are not at the bottom of the last block). |
@mattyrob I think what you are describing is arrow keys navigation, which is already implemented (#520) even if currently it's a bit buggy, and no one here is proposing to remove that. This issue is about navigation with the Tab key, which is a different matter.:
|
This ticket was mentioned in Slack in #core-editor by jeffpaul. View the logs. |
Just tested again on current master (41cde56). Seems to me something has changed regarding keyboard navigation through blocks, but the original issue still stands: when tabbing backwards, users are forced to tab through too many UI controls before they actually get the previous block. Fix toolbar to the top "on":
Fix toolbar to the top "off":
Overall, I think keyboard navigation has been a bit overlooked in the last releases and probably needs a bit more focus and, hopefully, some improvements. |
I think this could be addressed by the proposed third position for the formatting toolbars (see #3976) together with the proposed "navigation mode and edit mode", see #5694. @moorscode do you think those 2 proposals would address your concerns? |
See #3976 that should be in the a11y merge proposal as the approach proposed there would solve this issue. |
To reduce complexity in the text below, I like to clarify some words I will be using and what they represent.
How I think this should work: When the focus is on a button which is not the first one in a list of buttons, the "previous" button should be focussed, instead of leaving the list to focus the "previous" element. Example:
Motivation for this specification:
|
It is interesting to note that, when it comes to the toolbars (or styling bar of formatting toolbar whatever we want to call them) part of the issue @moorscode and @hedgefield highlighted above could be addressed just following the ARIA keyboard interaction pattern for toolbars. Reference: Putting it simply, ARIA toolbars have just one tabbable element at a time. So when tabbing through the UI, a toolbar is just one tab stop. Pressing again Tab or Shift+Tab, navigates to the following or previous focusable element. Once the toolbar gets focus, its buttons can be navigates with arrows only. Also, the You can try it ourself on the W3C example: https://www.w3.org/TR/wai-aria-practices/examples/toolbar/toolbar.html The great advantage of this pattern is that it greatly decreases the number of tab stops in the UI. Keyboard users are not forced to always navigate through all the buttons in a toolbar. Maybe they just need to get to the block mover buttons, or to the More options button: why we should force them to navigate through the whole toolbar each time? Instead, when they need to operate on the toolbar buttons, they can just Tab to the toolbar and then user the arrow keys. From the ARIA authoring practices linked above:
In other words, it has just one focusable button at a time. Initial focus goes on the first focusable control.
This is the "roving tabindex" behavior which is used on the W3C example and also on the TinyMCE toolbars (press Alt+F10 to move to the toolbar and focus will be placed on the button that previously had focus). Worth noting the roving tabindex as previously discussed also on #578 and #3281 As far as I see, the first part would be relatively simple to implement: just switch all the toolbar focusable controls to |
Andreas previous comment makes sense to me. As a side note, arrow up/down keys seems the best way to navigate from block to block at the moment, when the focus is in the block content. |
+1 for the idea from @afercia to use the W3C toolbar pattern. I think this would make life easier for keyboard and screen reader users. Not sure how the idea of having jump links to the panels on the right hand side would fit in, but I suppose that could be the first element in the toolbar? @samikeijonen Not sure if I've understood your comment on up/down arrow keys. If I'm updating a paragraph (behaves like a textbox) then I'd expect the up/down arrow keys to take me up or down a line within the currently active text. |
I ment at the moment (still in v 3.1) that's how it works. But I'm not sure should should up/down arrow keys stay inside a current block. |
@samikeijonen Yes, it's my view that up and down arrow keys should stay within the same block. |
This is precisely how it works. Am I missing anything? |
I just tested this in Windows 10 Edge and indeed, the arrow keys move between blocks without focusing the block toolbar. Perhaps we could add such tests to https://github.com/WordPress/gutenberg/blob/master/test/e2e/specs/writing-flow.test.js, but this is working in the editor. Of course, the reverse- |
Contact Info jetpack native blocks behind DEV flag
Issue Overview
When entering some text in a block and moving to the next block, I want to be able to quickly return to the previous block to change my typo or revise my content.
Steps to Reproduce (for bugs)
Expected Behavior
I expect to more easily return to the block I came from.
Possible Solution
It would be acceptable to have either a short-key to jump to the previous block or have a navigational choice about going to the 'toolbar', 'block-controls' or 'previous block'.
The text was updated successfully, but these errors were encountered: