From fd53887d5fc0dd8f9102edaa7c7bb6d2a14c61da Mon Sep 17 00:00:00 2001 From: Alban Bailly Date: Wed, 4 Dec 2024 09:40:49 -0500 Subject: [PATCH] feedback @hkhalil-akamai --- packages/ui/src/components/TextField/TextField.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/ui/src/components/TextField/TextField.tsx b/packages/ui/src/components/TextField/TextField.tsx index 5bdd6e0f5be..34ca3bc0053 100644 --- a/packages/ui/src/components/TextField/TextField.tsx +++ b/packages/ui/src/components/TextField/TextField.tsx @@ -258,6 +258,7 @@ export const TextField = (props: TextFieldProps) => { fallbackId); const helperTextId = `${validInputId}-helper-text`; + const errorTextId = `${validInputId}-error-text`; const labelSuffixText = required ? '(required)' @@ -325,6 +326,7 @@ export const TextField = (props: TextFieldProps) => { marginTop: theme.spacing(), }} data-qa-textfield-helper-text + id={helperTextId} > {helperText} @@ -373,6 +375,8 @@ export const TextField = (props: TextFieldProps) => { }} inputProps={{ 'aria-describedby': helperText ? helperTextId : undefined, + 'aria-errormessage': errorText ? errorTextId : undefined, + 'aria-invalid': !!error || !!errorText, 'data-testid': 'textfield-input', id: validInputId, ...inputProps,