-
Notifications
You must be signed in to change notification settings - Fork 921
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
Mobile navigation dialog does not make background content inert #3527
Comments
@jaredcunha I'm sorry, this issue slipped through the cracks for me. Does it have any relevance to your work on modal — or, can any of your work on modal be applied to header to address this issue? To be clear, I'm not asking you to do this, only if we in Core can apply your work to this? |
@thisisdano Modals address this by applying Those are removed when the modal closes. I have noticed that the mobile navigation does not render background content inert, so using Voice Over, it's still possible to exit the menu and interact with other content on the page either by dragging a finger around the page on a mobile device or by pulling up the rotor menu. |
Confirmed. Users are able to access page content while menu nav is open. This happens when:
This happened on all browsers tested: Safari 15.1, Firefox 89.0, Chrome, iOS Safari. |
Description
When the mobile navigation menu drawer is activated, it appears to behave like a dialog, where focus is trapped and background content is dimmed and seemingly intended to be unreachable as long as the drawer is visible. However, the content is still present in the accessibility tree, and is still otherwise reachable by focus means not handled currently by the focus trap behaviors. Users who use screen reader tools to navigate page contents (e.g. VoiceOver Web Item rotor) can still access contents outside the dialog.
Steps to reproduce the issue
Expected behavior: Because focus has moved outside the drawer, it may make sense that the drawer be dismissed. This follows behavior of clicking the overlay to dismiss the navigation drawer, which is another means of moving focus outside the navigation contents.
Actual behavior: The navigation drawer remains open while focus moves around the page.
Alternatively, using macOS VoiceOver Rotor:
Expected behavior: Only the contents of the dialog are presented in the rotor.
Actual behavior: All page contents are presented in the rotor. Navigating to said page contents will not dismiss the visible drawer.
Additional information
While the sample codes do not assign the
dialog
role, it does appear to inherit many of the behaviors associated with the role:(Aside: It might be a separate issue to consider if the
role
should be explicitly assigned)https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/dialog_role#Notes
(Emphasis mine)
https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/dialog.html
(Emphasis mine)
https://www.w3.org/TR/wai-aria-1.1/#aria-modal
https://developer.paciellogroup.com/blog/2018/06/the-current-state-of-modal-dialog-accessibility/
Note: This last article has a lot of important guidance around "gotchas" of dialog behaviors and incompatibilities of various implementations.
Relevant JavaScript code: https://github.com/uswds/uswds/blob/develop/src/js/components/navigation.js
Earlier related issue: #2031 (initial focus trapping added in #2347)
The text was updated successfully, but these errors were encountered: