Skip to content

Commit

Permalink
fix(a11y): apply aria-hidden to checkbox asterisk (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
MelissaDTH authored and dbudzins committed Mar 15, 2024
1 parent 9ee491f commit bd2ed00
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ exports[`<Account> > renders and matches snapshot 1`] = `
for="check-box_1235_consentsvalues_marketing"
lang="en"
>
<span
aria-hidden="true"
/>
Receive Marketing Emails
</label>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-react/src/components/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const Checkbox: React.FC<Props> = ({ label, name, onChange, header, checked, val
aria-describedby={helperTextId}
/>
<label htmlFor={id} lang={lang}>
{required ? '* ' : ''}
<span aria-hidden="true">{required ? '* ' : ''}</span>
{label}
</label>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ exports[`<Checkbox> > renders and matches snapshot 1`] = `
<label
for="check-box_1235_name"
>
<span
aria-hidden="true"
/>
label
</label>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ exports[`<CustomRegisterField> > renders and matches snapshot <Checkbox> 1`] = `
<label
for="check-box_1235_name"
>
<span
aria-hidden="true"
/>
label
</label>
</div>
Expand Down Expand Up @@ -156,6 +159,9 @@ exports[`<CustomRegisterField> > renders and matches snapshot <Dropdown type="ra
<label
for="check-box_1235_name"
>
<span
aria-hidden="true"
/>
label
</label>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,11 @@ exports[`<PersonalDetailsForm> > Renders with errors 1`] = `
<label
for="check-box_1235_ccc"
>
*
<span
aria-hidden="true"
>
*
</span>
CheckMe
</label>
</div>
Expand Down Expand Up @@ -942,7 +946,11 @@ exports[`<PersonalDetailsForm> > Renders without crashing 1`] = `
<label
for="check-box_1235_ccc"
>
*
<span
aria-hidden="true"
>
*
</span>
CheckMe
</label>
</div>
Expand Down

0 comments on commit bd2ed00

Please sign in to comment.