Skip to content

Commit

Permalink
fix: Potential a11y issue with switch #822 (#1121)
Browse files Browse the repository at this point in the history
* refactor: adding aria-hidden

* fix: failing unit test
  • Loading branch information
marvinLaubenstein authored Jul 4, 2022
1 parent 6b4e505 commit 4e959aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`Switch should match snapshot 1`] = `
<input aria-labelledby="switch-0-label" id="switch-0" type="checkbox">
<div class="switch__wrapper">
<div class="switch__toggle"></div>
<div class="switch__text"></div>
<div aria-hidden="true" class="switch__text"></div>
</div>
</label>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/switch/switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class Switch {
/>
<div class="switch__wrapper">
<div class="switch__toggle" />
<div class="switch__text" />
<div class="switch__text" aria-hidden="true" />
</div>
{this.label && <span class="switch__label">{this.label}</span>}
</label>
Expand Down

0 comments on commit 4e959aa

Please sign in to comment.