-
Notifications
You must be signed in to change notification settings - Fork 101
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
fix(ui-menu): screenreaders should read the correct number of menu items #1831
base: master
Are you sure you want to change the base?
Conversation
Closes: INSTUI-4285 Tested on VoiceOver, NVDA, JAWS. Also simplified DOM structure quite a bit TEST PLAN: Open the Menu example and go trough it with NVDA, JAWS, VoiceOver. You should be able to navigate and they should read the correct menu item number (e.g. 3 of 7)
@@ -187,8 +187,6 @@ class MenuItem extends Component<MenuItemProps, MenuItemState> { | |||
return 'menuitemcheckbox' | |||
case 'radio': | |||
return 'menuitemradio' | |||
case 'flyout': | |||
return 'button' |
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.
A Menu having a button
not a menuitem
was driving NVDA crazy. NVDA really seems to be the most strict of them all
css={this.props.styles?.items} | ||
aria-disabled={this.props.disabled ? 'true' : undefined} | ||
aria-labelledby={this._labelId} |
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.
there is no need for aria-labelledby
. Also its not usable for generic elements
ref={this.handleRef} | ||
> | ||
<span id={this._labelId}>{this.renderLabel()}</span> | ||
<ul | ||
role="menu" |
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.
This should be used for submenus and menus, not for groups per specification https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/menu_role
|
Closes: INSTUI-4285
Tested on VoiceOver, NVDA, JAWS. Also simplified DOM structure quite a bit, there are multiple examples of Menu online that do not use a List to wrap the whole thing, it was not needed
TEST PLAN:
Open the Menu example and go trough it with NVDA, JAWS, VoiceOver. You should be able to navigate and they should read the correct menu item number (e.g. 3 of 7).
Check the DOM structure with the inspector to see if it looks OK