-
Notifications
You must be signed in to change notification settings - Fork 83
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
feat(loader): remove progressbar role and add loaderLabel prop #7176
Conversation
26ea9cd
to
0407695
Compare
src/components/loader/loader.mdx
Outdated
|
||
Please note that ARIA live regions provide a means for conveying dynamic updates to users who rely on assistive technologies like screen readers. | ||
These updates in this case include changes to the button's content. By incorporating live regions permanently into the DOM, we can ensure that users are consistently informed of relevant changes as they occur. | ||
Note that `Loader` has a role of "status", meaning it has an implicit `aria-live="polite"` and will be announced by screen readers. |
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.
🔥
<Button | ||
m={2} | ||
buttonType="primary" | ||
aria-label={ariaContent} |
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.
Question (non-blocking): Does this need an aria-label at all when isLoading is false as there's text content at that point?
const ariaContent = isLoading ? "Loading" : undefined;
Removes role of progressbar in Loader as this fails WCAG 1.3.1. Adds loaderLabel prop to provide a visually hidden label for the component. Deprecates the 'aria-label' prop in favour of the new label prop. fix #6956
Reviewed this and spoke with Martin about it as well. We may need to document how users can add aria-polite around a container where it might be needed on a dynamic usage of loader but as updated the component itself does not need it out the box. |
🎉 This PR is included in version 147.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
fix #6956
Proposed behaviour
aria-label
prop.loaderLabel
prop to set a visually hidden label for the component instead of an aria-label.Current behaviour
Loader
has role of "progressbar".Checklist
d.ts
file added or updated if requiredQA
Additional context
Testing instructions