-
Notifications
You must be signed in to change notification settings - Fork 351
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
chore: fix various a11y violations in examples (3) #7619
chore: fix various a11y violations in examples (3) #7619
Conversation
Preview: https://patternfly-react-pr-7619.surge.sh A11y report: https://patternfly-react-pr-7619-a11y.surge.sh |
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.
Looks good! 🎉 Only thing I noticed is on the Dual List Selector examples is aXe is catching the error "Ensures landmarks are unique" due to the dual list selector controls with role="region"
and the same aria-label
. Otherwise I only had a question below.
@@ -76,7 +76,7 @@ DualListSelectorControlsWrapperBase.displayName = 'DualListSelectorControlsWrapp | |||
|
|||
export const DualListSelectorControlsWrapper = React.forwardRef( | |||
(props: DualListSelectorControlsWrapperProps, ref: React.Ref<HTMLDivElement>) => ( | |||
<DualListSelectorControlsWrapperBase innerRef={ref as React.MutableRefObject<any>} {...props} /> | |||
<DualListSelectorControlsWrapperBase innerRef={ref as React.MutableRefObject<any>} {...props} role="region" /> |
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.
For the role, would "region" or "group" be better in this context? Currently the selector controls appear in VO's rotor under "landmarks", and wasn't sure if that may have been part of the intent or not.
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.
ooo good thought
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.
Looks like dual list selector snapshots just need to be updated, but otherwise looks good to me!
@@ -76,7 +76,7 @@ DualListSelectorControlsWrapperBase.displayName = 'DualListSelectorControlsWrapp | |||
|
|||
export const DualListSelectorControlsWrapper = React.forwardRef( | |||
(props: DualListSelectorControlsWrapperProps, ref: React.Ref<HTMLDivElement>) => ( | |||
<DualListSelectorControlsWrapperBase innerRef={ref as React.MutableRefObject<any>} {...props} /> | |||
<DualListSelectorControlsWrapperBase innerRef={ref as React.MutableRefObject<any>} {...props} role="group" /> |
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.
Are spreading props before the role here incase someone tries to override it?
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 don't think so - I will spread props at the end
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.
LGTM! :)
Testing this does remind me that Dual List selector with tree items isn't accessible by VO though. Do we already have an issue open for that? I thought we did, but I can't find it at the moment.
* chore: fix various a11y violations in examples (3) * clean up tests * fix context selector tests * fix broken props table * change controls' role from region to group * update snapshots * spread props at end of duallistselectorcontrolswrapperbase
What: Closes #7610
few notes:
id
to the unit test cases so they would be the same across snapshots. Also, the items inside context selector menus did not have therole='menuitem'
so I added it.aria-multiselectable
,aria-labelledby
,aria-activedescendant
, androle=tree|listbox
should only be applied when they have the requisite valid children with valid roles. In the case of empty lists, they should not have those roles (according to the axe tests).