fix(a11y)-9: remove label role from DropZoneBox UploadFiles button to meet ARIA specs#4390
fix(a11y)-9: remove label role from DropZoneBox UploadFiles button to meet ARIA specs#4390Sagar-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 |
|
/cc @sniok |
Signed-off-by: Sagar Choudhary <sagar6203620715@gmail.com>
527bf14 to
fadc704
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the DropZoneBox Storybook example to address an ARIA “allowed role” accessibility violation by ensuring the “Select File” control is rendered as a native button rather than a label.
Changes:
- Removed
component="label"from the MUIButtonused in theDropZoneBox“UploadFiles” story to avoid rendering alabelwith an invalid ARIA role.
Comments suppressed due to low confidence (2)
frontend/src/components/common/DropZoneBox.stories.tsx:41
- PR description/title mentions adding an
aria-labeltoVersionDialog/ fixing an ARIA dialog name violation, but this PR change only updatesDropZoneBox.stories.tsx(removingcomponent="label"). Please update the PR title/description to match the actual change, or include the missingVersionDialogchange in this PR.
<Button
variant="contained"
startIcon={<InlineIcon icon="mdi:upload" width={32} />}
sx={{ fontWeight: 500 }}
>
{'Select File'}
</Button>
frontend/src/components/common/DropZoneBox.stories.tsx:41
UploadFilesstory now renders a plain button labeled "Select File" without any associated<input type="file">or click handler, so it doesn't actually demonstrate file selection behavior. Consider either wiring it to a hidden file input (without usingcomponent="label", e.g., viainputRef.click()/htmlFor) or renaming the story/button text to avoid implying functionality it doesn't provide.
export const UploadFiles = Template.bind({});
UploadFiles.args = {
children: (
<>
<Typography sx={{ m: 2 }}>{'Select a file or drag and drop here'}</Typography>
<Button
variant="contained"
startIcon={<InlineIcon icon="mdi:upload" width={32} />}
sx={{ fontWeight: 500 }}
>
{'Select File'}
</Button>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
|
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 adding an accessible name to the VersionDialog.
Related Issue
Partially fixes #4385
Addresses point 9 from the issues #4385
Changes
VersionDialogto include anaria-labelSteps to Test
npm run frontend:test:a11yScreenshots (if applicable)
N/A
Notes for the Reviewer