fix(a11y) -12: Replace label with span and move aria-expanded to IconButton#4388
fix(a11y) -12: Replace label with span and move aria-expanded to IconButton#4388Sagar-6203620715 wants to merge 0 commit intokubernetes-sigs:mainfrom
Conversation
|
Welcome @Sagar-6203620715! |
5cc4b5a to
eed3b33
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the ShowHideLabel component to comply with ARIA specifications for allowed attributes and roles, particularly addressing the axe-tracked “ARIA Allowed Attributes” issues for this component’s stories.
Changes:
- Replaced the non-interactive
labelelement with aspanto avoid invalid ARIA usage. - Moved the
aria-expandedstate to the interactiveIconButtonthat actually toggles expansion. - Ensured the Basic and Expanded Storybook stories use the updated, ARIA-compliant
ShowHideLabelmarkup via the component change.
Comments suppressed due to low confidence (1)
frontend/src/components/common/ShowHideLabel/ShowHideLabel.tsx:76
- The
IconButtonis using a misspelledarial-labelprop instead ofaria-label, so the accessible name will not be exposed to assistive technologies and an unusedarial-labelattribute will be rendered to the DOM. Please update this to the correctaria-labelattribute so screen readers can announce the expand/collapse action properly.
<IconButton
aria-controls={labelIdOrRandom}
aria-expanded={expanded}
sx={{ display: 'inline' }}
onClick={() => setExpanded(expandedVal => !expandedVal)}
size="small"
arial-label={expanded ? t('translation|Collapse') : t('translation|Expand')}
>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7ba0eee to
6e59afb
Compare
|
[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 |
|
I see you pushed some changes after closing the PR... maybe closing the PR was an accident? |
Summary
This PR fixes accessibility issues by ensuring valid ARIA usage in the ShowHideLabel component.
Related Issue
Partially fixes #4385
Addresses point 12 from issue description
Changes
labelelement withspanto meet ARIA specificationsaria-expandedto the interactiveIconButtonSteps to Test
ShowHideLabelcomponentScreenshots (if applicable)
N/A
Notes for the Reviewer