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

Top toolbar: adjust tab order #19623

Merged
merged 2 commits into from
Jan 14, 2020
Merged

Top toolbar: adjust tab order #19623

merged 2 commits into from
Jan 14, 2020

Conversation

ellatrix
Copy link
Member

Description

This PR changes the tab order of the top toolbar. To test, enable the "Top toolbar" under "More tools & options".

The idea is to make tab order the same for the contextual toolbar and the top toolbar: when you press Shift+Tab from a block, first the block toolbar should receive focus and only then the settings, publish button and so on.

This may look a lot counter-intuitive because the block toolbar is left and appears visually before the publish buttons on the right side, but it could be thought of a separate column/area.

In addition to making it easier to access the block toolbar when "Top toolbar" is enabled, it will also allow us to unify the top toolbar, mobile, and contextual toolbar.

Would love feedback from accessibility experts.

How has this been tested?

Screenshots

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR. .

@ellatrix ellatrix added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Needs Accessibility Feedback Need input from accessibility labels Jan 14, 2020
@ellatrix ellatrix requested a review from talldan as a code owner January 14, 2020 12:15
@ellatrix
Copy link
Member Author

Alternatively, and I don't know if this is possible with CSS, the publish button etc. could move after the block editor, but still display in its current block. Cc @jasmussen

@ellatrix
Copy link
Member Author

I will try to create an alternative PR where the publish button etc. appears in the same area as the publish sidebar/region, and where it is still positioned above the block/document settings. That might be better than this PR.

@MarcoZehe
Copy link
Contributor

Tab order follows the DOM order, not the CSS order. So, if it is clearly visible that the publish button and other items from the top toolbar are not part of the current block, but positioned higher up, the shift+tab order first to the items in the Block toolbar, and then further up makes sense. I don't know how this is aligned visually, though, especially when the block gets bigger (a long paragraph, for example). But intuitively, I'd say even when the top toolbar is activated, which I'd always associate with the entire post/page editing session, not the current block, this change makes sense.

@ellatrix
Copy link
Member Author

ellatrix commented Jan 14, 2020

I changed my mind on this. I think we should move these buttons to the publish region. See #19625.

@ellatrix ellatrix closed this Jan 14, 2020
@ellatrix ellatrix deleted the try/top-toolbar-tab-order branch January 14, 2020 13:24
@ellatrix ellatrix restored the try/top-toolbar-tab-order branch January 14, 2020 14:21
@ellatrix ellatrix reopened this Jan 14, 2020
@MarcoZehe
Copy link
Contributor

@ellatrix and I discussed this on Slack, and I was concerned that the alternative approach from #19625 would feel like it getting in the way between the active block in editing mode and its side bar. This was one of the well-received changes from version 7.2.0, and the alternative PR felt like we were taking away that advantage again. Also, it is more logical in that both the stuff in the top toolbar that is always there, and the publishing and other options items, pertain to the whole document and thus make sense grouped together at the top. So the order would be across the top first, and then into the title and current block or the blocks (when in navigation mode), and into the side bar from the active block directly.

Copy link
Contributor

@MarcoZehe MarcoZehe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving these changes based on above comment.

@ellatrix
Copy link
Member Author

Sounds good. #19427 will make the connection between the selected block and sidebar even better.

@ellatrix ellatrix merged commit b55605e into master Jan 14, 2020
@ellatrix ellatrix deleted the try/top-toolbar-tab-order branch January 14, 2020 18:04
@@ -4,6 +4,7 @@
background: $white;
display: flex;
flex-wrap: wrap;
flex-direction: row-reverse;
Copy link
Member

@gziolo gziolo Jan 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting approach, I wouldn’t think that you can tweak DOM order and change it back visually with CSS to make the experience better for keybord-only users 😃

I’m looking forward to the next plugin release to see how it plays out.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'm curious. It's debatable whether this is ok visually, but the large gap between the two areas and the fact that it's almost split at the column boundary may make it ok.

@ellatrix ellatrix added this to the Gutenberg 7.3 milestone Jan 20, 2020
@afercia
Copy link
Contributor

afercia commented Feb 26, 2020

Unfortunately, this change seriously broke accessibility on the desktop view, whether the "top toolbar" setting is enabled or not.

In the DOM order, the header "settings" and the header "toolbar" have been swapped.
However, visually they're in the same position as before because the CSS uses the flex property flex-direction: row-reverse;.

This is a serious WCAG failure as the visual order doesn't match the DOM order any longer.

Tabbing into the editor toolbar now sets focus on the Preview, Publish, Settings buttons as first elements, which are visually displayed on the right.

Keeping tabbing moves focus to the Add block, Undo, Redo, etc. buttons which are displayed on the left.

WordPress is in Beta 3 now and this is a serious accessibility regression that should be fixed for 5.4. Will create a Trac ticket.

@ellatrix ellatrix mentioned this pull request Mar 2, 2020
6 tasks
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). Needs Accessibility Feedback Need input from accessibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants