fix(ui-menu): screenreaders should read the correct number of menu items#1831
Merged
fix(ui-menu): screenreaders should read the correct number of menu items#1831
Conversation
matyasf
commented
Dec 18, 2024
| case 'radio': | ||
| return 'menuitemradio' | ||
| case 'flyout': | ||
| return 'button' |
Collaborator
Author
There was a problem hiding this comment.
A Menu having a button not a menuitem was driving NVDA crazy. NVDA really seems to be the most strict of them all
matyasf
commented
Dec 18, 2024
| <div | ||
| css={this.props.styles?.items} | ||
| aria-disabled={this.props.disabled ? 'true' : undefined} | ||
| aria-labelledby={this._labelId} |
Collaborator
Author
There was a problem hiding this comment.
there is no need for aria-labelledby . Also its not usable for generic elements
matyasf
commented
Dec 18, 2024
| > | ||
| <span id={this._labelId}>{this.renderLabel()}</span> | ||
| <ul | ||
| role="menu" |
Collaborator
Author
There was a problem hiding this comment.
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
|
balzss
requested changes
Feb 3, 2025
Contributor
balzss
left a comment
There was a problem hiding this comment.
left one comment but otherwise looks and works well, great job
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)
HerrTopi
approved these changes
Feb 3, 2025
balzss
approved these changes
Feb 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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