-
Notifications
You must be signed in to change notification settings - Fork 18
chore(components): update language switch accessible names and roles #5350
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
base: main
Are you sure you want to change the base?
chore(components): update language switch accessible names and roles #5350
Conversation
🦋 Changeset detectedLatest commit: 223a5ba The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Related Previews |
.changeset/stale-dogs-hope.md
Outdated
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.
Maybe you could split it into two changesets:
-
'@swisspost/design-system-components': patch
Enhanced accessibility ofpost-language-switch
component by replacingaria-labels
withvisually-hidden
spans and properly assigning semanticrole
attributes. -
'@swisspost/design-system-documentation': patch
Added comprehensive accessibility guidance topost-language-switch
documentation with practical examples showing how to correctly match visible text with thename
prop to ensure speech recognition compatibility.
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.
Nice idea! :)
packages/documentation/src/stories/components/language-switch/language-switch.docs.mdx
Outdated
Show resolved
Hide resolved
packages/components/src/components/post-language-switch/post-language-switch.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/components/post-language-switch/post-language-switch.tsx
Outdated
Show resolved
Hide resolved
…ch' of https://github.com/swisspost/design-system into 5108-language-switch-label-and-accessible-name-dont-match
|
📄 Description
This PR initial goal was to fix non conformity with the https://www.w3.org/WAI/WCAG22/Understanding/label-in-name accessibility guideline. Instead of modifying the
aria-label
content this PR replaces thearia-labels
set on the contained button elements with descriptive visually hidden span texts. List variant 'role' attrs are modified to correctly recognize list items. An info box is added in the language switch page of the documentation to inform about proper usage of thename
language option prop.📝 Checklist