diff --git a/ui/components/component-library/input/input.tsx b/ui/components/component-library/input/input.tsx index 5ff59c7a696b..7dc30ea4460d 100644 --- a/ui/components/component-library/input/input.tsx +++ b/ui/components/component-library/input/input.tsx @@ -47,7 +47,7 @@ export const Input: InputComponent = React.forwardRef( }, className, )} - aria-invalid={error} + {...(error && { 'aria-invalid': error })} as="input" autoComplete={autoComplete ? 'on' : 'off'} autoFocus={autoFocus} diff --git a/ui/components/component-library/text-field/text-field.js b/ui/components/component-library/text-field/text-field.js index 9cccd1bb7c6b..40564c9bfb1c 100644 --- a/ui/components/component-library/text-field/text-field.js +++ b/ui/components/component-library/text-field/text-field.js @@ -113,7 +113,7 @@ export const TextField = ({ > {startAccessory}