Fix region navigation in the post and site editor #46800
Labels
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
[Package] Components
/packages/components
[Package] Interface
/packages/interface
[Type] Bug
An existing feature does not function as intended
[Type] Regression
Related to a regression in the latest release
Description
Follow-up to #46525 and #45369
After recent changes, the navigate regions functionality and its focus style don't work well in the post editor and site editor.
1
#46525 partially reverted #45369 moving back to a a focus style that is based on a CSS pseudo element. This approach has already been tried long time ago and it turned out it doesn't work well because the pseudo element on the content section scrolls together with the content itself. We need a different approach. For more details, please see this comment: #46525 (comment)
2
In the post editor, the 'Open publish panel' and 'Open document settings' regions, when they only contain the toggle buttons (i.e. when the sidebar is closed) still show a focus style even when focus is actually on the button. In the screenshots below, the button is focused. However, the small regions around the buttons show a focus style:
This happens only in the post editor. In the site editor it works as expected. Screenshot:
3
In the post editor, the Publish panel always shows a focus style when navigating through the regions, even when the actual focused region is another one. In the screenshot below the top bar is the focused region but the Publish sidebar still shows a focus style:
4
In the Site editor, the keyboard shortcut to navigate through the regions doesn't work well in browse mode when the Navigation sidebar is open. In this view, there are only two regions: the sidebar and the content. Turns out the sidebar region (the element with
aria-label="Navigation sidebar" role="region"
) is actually hidden withvisibility: hidden
. This comes from thecustom-scrollbars-on-hover
mixin. Only on :hover and :focus this element getsvisibility: visible
. As a consequence:visibility: hidden
is equivalent todisplay: none
. Screenshot from the Chrome dev tools > Accessibility tab, to illustrate the element is not exposed:As a consequence, screen readers won't perceive this element as an ARIA landmark. Native landmarks navigation won't work. Screenshot from VoiceOver, where the Navigation sidebar is not listed amongst the available landmark. Only the
<nav>
element within the sidebar is listed. Notice the mouse pointer hovers the content area.When hovering the sidebar the landmark gets
visibility: visible
and it gets exposed as a native ARIA landmark. In the screenshot below, notice the mouse pointer hovers the sidebar. VoiceOver now lists the Navigation sidebar amongst the available landmarks:5
In the Site editor, the
SiteHub
component (the one with the 'Go back' link / Toggle navigation and Edit button) is placed outside of any editor landmarks. It's only contained by themain
element. The navigate regions feature won't include this part of the UI in the navigable regions because it's not a 'region'. Ideally,SiteHub
should be within the sidebar.Step-by-step reproduction instructions
Post editor:
Site editor:
SiteHub
component is fine.SiteHub
component is rendered outside of the navigation ARIA region and that it's not possible to navigate to it by using the navigate regions feature.Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: