chore: fix various a11y violations in examples (3)#7619
chore: fix various a11y violations in examples (3)#7619tlabaj merged 7 commits intopatternfly:mainfrom
Conversation
|
Preview: https://patternfly-react-pr-7619.surge.sh A11y report: https://patternfly-react-pr-7619-a11y.surge.sh |
thatblindgeye
left a comment
There was a problem hiding this comment.
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.
| 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.
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.
ooo good thought
thatblindgeye
left a comment
There was a problem hiding this comment.
Looks like dual list selector snapshots just need to be updated, but otherwise looks good to me!
| 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.
Are spreading props before the role here incase someone tries to override it?
There was a problem hiding this comment.
I don't think so - I will spread props at the end
jessiehuff
left a comment
There was a problem hiding this comment.
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:
idto 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|listboxshould 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).