fix(a11y)-10: add accessible name to Loader progress indicator when t…#4394
fix(a11y)-10: add accessible name to Loader progress indicator when t…#4394Sagar-6203620715 wants to merge 1 commit intokubernetes-sigs:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Sagar-6203620715 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Signed-off-by: Sagar Choudhary <sagar6203620715@gmail.com>
825f7ab to
2954d71
Compare
There was a problem hiding this comment.
Pull request overview
This PR addresses an accessibility violation by ensuring the Loader component's progress indicator always has an accessible name, fixing issue #4385 point 10 (ARIA progressbar name).
Changes:
- Added
aria-labelattribute to theCircularProgresscomponent with a fallback value of "Loading" when the title prop is empty
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| export default function Loader(props: LoaderProps) { | ||
| const { noContainer = false, title, ...other } = props; | ||
| const progress = <CircularProgress title={title} {...other} />; | ||
| const progress = <CircularProgress title={title} aria-label={title || 'Loading'} {...other} />; |
There was a problem hiding this comment.
The new aria-label attribute is not covered by tests. The existing test at line 76-85 in Loader.test.tsx only checks the title attribute when it's empty, but doesn't verify that aria-label is set to "Loading" in that case. Consider adding test assertions to verify that aria-label is correctly set to the title value when provided, and to "Loading" when the title is empty.
illume
left a comment
There was a problem hiding this comment.
Thanks for this!
To update the snapshots you can run this.
npm run test -- -u
You can check things locally with these commands.
npm run tsc
npm run lint
npm run test
npm run format
Please check the open comments?
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
hey hey. I'll mark this as draft for now to make it easier on reviewers. If you want to continue it, please mark it as ready to review when you've pushed changes. |
Summary
This PR fixes an accessibility issue by ensuring the Loader progress indicator always has an accessible name.
Related Issue
Partially fixes #4385
Addresses point 10 (ARIA progressbar name)
Changes
Loaderto add anaria-labeltoCircularProgress"Loading") when thetitleprop is emptySteps to Test
npm run frontend:test:a11yScreenshots (if applicable)
N/A
Notes for the Reviewer