-
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
base: master
Are you sure you want to change the base?
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;
|
||
### Conditional Rendering | ||
|
||
In most cases, Loaders are conditionally rendered on the page and are then replaced by content. |
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.
praise: this is much simpler now 👍🏼
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
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