Skip to content

Commit

Permalink
fix: only add aria-labelledby to checkbox it there is a label
Browse files Browse the repository at this point in the history
  • Loading branch information
noa.santo committed Sep 18, 2024
1 parent f861e25 commit 6d9e5b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/forms/checkbox/checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const Checkbox = (
<HiddenCheckbox
aria-required={true}
aria-describedby={errorMessage && `${props.name}-error`}
aria-labelledby={`${props.name}-label`}
aria-labelledby={props.label && `${props.name}-label`}
aria-invalid={Boolean(errorMessage)}
disabled={formState.isSubmitting}
{...field}
Expand Down

0 comments on commit 6d9e5b6

Please sign in to comment.