-
Notifications
You must be signed in to change notification settings - Fork 1
Danielle/610-a11y-menu-controls-not-screenreader-accessible #661
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
base: develop
Are you sure you want to change the base?
Changes from 3 commits
f1481d0
60ad3cb
f7e58e1
b293510
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,8 +61,15 @@ export const Nav = (): JSX.Element => { | |
| <ul> | ||
| <li> | ||
| <Drawer open={open} onOpenChange={setOpen}> | ||
| <DrawerTrigger data-testid="drawer-trigger"> | ||
| <Menu className="text-foreground" /> | ||
| <DrawerTrigger | ||
| data-testid="drawer-trigger" | ||
| aria-haspopup='menu' | ||
| aria-label='open navigation menu' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Menu" should be enough for the name. That's the name that voice users expect from the hamburger icon. Screen reader users will learn it's a button that opens a dialog.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. resolved |
||
| > | ||
| <Menu | ||
| className="text-foreground" | ||
| aria-hidden='true' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The drawer trigger button is a parent and is labeled. |
||
| /> | ||
| </DrawerTrigger> | ||
| <DrawerContent> | ||
| <DrawerHeader> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What we have it's just a navigation component, so it cannot take the role of
menu. If we were building a desktop application like Google Docs, then the “File”, “Edit” etc would each be assignedrole=menu. Power screen reader users expect certain keyboard functionality when they hear “menu” (e.g. tab to certain elements, then navigate with arrow keys, make use ofHome,Spacekeys, etc) and a site navigation really does not need this functionality.We (and everybody on the planet) use the term “menu” but technically a hamburger navigation is just a disclosure widget. A button with
aria-expandedthat toggles the visibility of the nav drawer would be enough. Very unlikely we’ll find a ready-built component like that. Most are built like dialogs.A
dialogis a bit of an overkill for a navigation component, but it’s not wrong. Dialog means that the drawer is overlaid on top of the rest of the content, and that the rest of the content is inert while the drawer is visible. The keyboard focus is kept inside the drawer, and the screen reader users know they first have to close it before accessing content outside the drawer. And our drawer does just that.My suggestion is to keep it as is for right now. Unless we want to implement a disclosure widget. But this is also a component that’s evolving in terms of its content. It will probably have user account info, maybe a search input. It’s not a bad idea to have it as a dialog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved