-
Notifications
You must be signed in to change notification settings - Fork 72
[terra-menu] - Fixed SR not announcing menu group name information. #1841
Conversation
@@ -2,11 +2,14 @@ | |||
|
|||
## Unreleased | |||
|
|||
* Added | |||
* Added aria-label custom prop and ariaDescribedBy first class prop for `terra-collapsible-menu-view` and `terra-menu` to help describe the intent of the group information. |
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.
* Added aria-label custom prop and ariaDescribedBy first class prop for `terra-collapsible-menu-view` and `terra-menu` to help describe the intent of the group information. | |
* Added `aria-label` and `ariaDescribedBy` for `terra-collapsible-menu-view` and `terra-menu` to help describe the intent of the group information. |
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.
Updated - 4cf4469
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.
Update it to
Added
aria-label
andariaDescribedBy
props
and it looks good!
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.
Updated - 3d48277
/** | ||
* String that labels the group for accessibility. | ||
*/ | ||
ariaLabel: PropTypes.string, |
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.
I think we still need this prop along with this prop we need to create a prop for GroupId so that it can be used in menu item for aria-describedby
attribute.
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.
Updated - 4cf4469
packages/terra-menu/CHANGELOG.md
Outdated
@@ -2,6 +2,9 @@ | |||
|
|||
## Unreleased | |||
|
|||
* Added | |||
* Added ariaDescribedBy first class prop to announce group information. |
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.
* Added ariaDescribedBy first class prop to announce group information. | |
* Added `ariaDescribedBy` prop for `menu-item` to announce group information. |
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.
Updated - 4cf4469
/** | ||
* String that used in menu item for aria-describedby that labels the group for accessibility. | ||
*/ | ||
GroupId: PropTypes.string, |
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.
GroupId: PropTypes.string, | |
groupId: PropTypes.string, |
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.
Updated -f8e50c8
@@ -120,7 +125,7 @@ class CollapsibleMenuViewItemGroup extends React.Component { | |||
]); | |||
|
|||
return ( | |||
<ButtonGroup {...customProps} isMultiSelect={isMultiSelect} onChange={onChange} className={buttonGroupClassNames} selectedKeys={selectedKeys} aria-label={ariaLabel}> |
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.
why did we removed ariaLabel ..? it is first class prop so we can still use them here correct..??
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.
Still consumer can able to pass aria-label as custom props in collapsible-menu that's why i have removed first class props, if required i can include first class props
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.
Updated - f8e50c8
3584b90
to
f8e50c8
Compare
@@ -612,7 +611,6 @@ exports[`Menu correctly applies the theme context className 1`] = ` | |||
totalItems={1} | |||
> | |||
<li | |||
aria-describedby="terra-menu-headertitle-00000000-0000-0000-0000-000000000000" |
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.
I think you need to update the menu content to use the new prop aria-describedBy
of menu-item. to get these ID's back . There as been change made on showHeader prop in menu with this PR : #1649
We might need a to re-test the scenarios of the above PR as well to ensure features added on PR-1649 are still working as expected.
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.
fc7b04a
to
a99b426
Compare
2882a7b
to
af27824
Compare
} | ||
if (!MenuUtils.isMac()) { | ||
if (!this.props.index && this.props.showHeader && index === 0 && value.props.ariaDescribedBy) { | ||
ariaDescribedByValue = `${this.menuTopHeaderId} ${value.props.ariaDescribedBy}`; |
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.
IDs should be comma separated values
ariaDescribedByValue = `${this.menuTopHeaderId} ${value.props.ariaDescribedBy}`; | |
ariaDescribedByValue = `${this.menuTopHeaderId}, ${value.props.ariaDescribedBy}`; |
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.
JAWS SR skipping menuHeaderId information If we add comma separated between ID's, SR been reading only second ID information.
@@ -342,6 +343,23 @@ class MenuContent extends React.Component { | |||
); | |||
} | |||
|
|||
ariaDescribedByHandle(value, index) { |
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 function can be simplified to
ariaDescribedByHandle(value, index) {
if (!MenuUtils.isMac() && !this.props.index && this.props.showHeader && index === 0) {
let ariaDescribedByValue = (value.props.ariaDescribedBy) ? `, ${value.props.ariaDescribedBy}` : '';
return `${this.menuTopHeaderId}${ariaDescribedByValue}`;
}
return value.props.ariaDescribedBy;
}
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.
Updated - 37d673e
+1 |
Summary
Screen Reader not fetching group name information because we are wrapping group role items within menu role
What was changed:
If additional group information text is used, provide a string containing the IDs for html elements that help describe the intent of the group of menu. so added
aria-describedby
attribute in menu items and passing group id to aria-describedbyWhy it was changed:
Screen Reader not fetching group name information
Testing
This change was tested using:
Reviews
In addition to engineering reviews, this PR needs:
Additional Details
This PR resolves:
UXPLATFORM-9744
Thank you for contributing to Terra.
@cerner/terra
Before fix
Screen.Recording.2023-10-18.at.3.22.52.PM.mov
After fix
Screen.Recording.2023-10-18.at.3.31.07.PM.mov
JAWS response for collapsible-menu and terra-menu