Skip to content

Commit

Permalink
fix: no aria-describedby attribute if it is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
kkmch committed Sep 5, 2023
1 parent 8858b80 commit f28d7b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/controls/TextArea/TextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export const TextArea = React.forwardRef<HTMLSpanElement, TextAreaProps>(functio
autoComplete: prepareAutoComplete(autoComplete),
controlProps: {
...controlProps,
'aria-describedby': ariaDescribedBy,
'aria-describedby': ariaDescribedBy || undefined,
'aria-invalid': Boolean(error) || undefined,
},
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/controls/TextInput/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const TextInput = React.forwardRef<HTMLSpanElement, TextInputProps>(funct
...(isLabelVisible && labelSize.width ? {paddingLeft: `${labelSize.width}px`} : {}),
},
'aria-invalid': Boolean(error) || undefined,
'aria-describedby': ariaDescribedBy,
'aria-describedby': ariaDescribedBy || undefined,
};
const commonProps = {
id,
Expand Down

0 comments on commit f28d7b2

Please sign in to comment.