Skip to content

Commit

Permalink
fix(17525): fixes a11y violation in toggle (#18216)
Browse files Browse the repository at this point in the history
Co-authored-by: Taylor Jones <[email protected]>
  • Loading branch information
2nikhiltom and tay1orjones authored Dec 11, 2024
1 parent 5b3df41 commit e6ee8dd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/react/src/components/Toggle/Toggle.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,17 @@ export const WithAccessibleLabels = () => (
<div id="toggle-6-label" style={{ marginBlockEnd: '0.5rem' }}>
Internal aria-label toggle
</div>
<Toggle aria-label="Internal aria-label toggle" id="toggle-6" hideLabel />
<Toggle aria-labelledby="toggle-6-label" id="toggle-6" />
</div>

<div>
<label
id="toggle-7-label"
htmlFor="toggle-7"
style={{ display: 'block', marginBlockEnd: '0.5rem' }}>
External toggle label
</label>
<Toggle id="toggle-7" hideLabel />
<Toggle aria-labelledby="toggle-7-label" id="toggle-7" />
</div>
</VStack>
);
Expand Down

0 comments on commit e6ee8dd

Please sign in to comment.