From 75953eae09cb5b0f020766842852ee4090faeb21 Mon Sep 17 00:00:00 2001 From: Barsnes Date: Fri, 19 Apr 2024 08:55:11 +0200 Subject: [PATCH] do as in textfield --- packages/css/react-css-modules.css | 2 +- packages/react/src/components/form/Textarea/Textarea.module.css | 2 +- packages/react/src/components/form/Textarea/Textarea.tsx | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/css/react-css-modules.css b/packages/css/react-css-modules.css index 2037c67248..ec1d997e94 100644 --- a/packages/css/react-css-modules.css +++ b/packages/css/react-css-modules.css @@ -2216,7 +2216,7 @@ border-color: var(--fds-semantic-border-neutral-default); } - .fds-textarea-textarea-3d0e29bc[aria-invalid='true']:not(:focus-visible) { + .fds-textarea-error-3d0e29bc > .fds-textarea-textarea-3d0e29bc:not(:focus-visible) { border-color: var(--fds-semantic-border-danger-default); box-shadow: inset 0 0 0 1px var(--fds-semantic-border-danger-default); } diff --git a/packages/react/src/components/form/Textarea/Textarea.module.css b/packages/react/src/components/form/Textarea/Textarea.module.css index a738e22f8e..123577d0d9 100644 --- a/packages/react/src/components/form/Textarea/Textarea.module.css +++ b/packages/react/src/components/form/Textarea/Textarea.module.css @@ -66,7 +66,7 @@ border-color: var(--fds-semantic-border-neutral-default); } - .textarea[aria-invalid='true']:not(:focus-visible) { + .error > .textarea:not(:focus-visible) { border-color: var(--fds-semantic-border-danger-default); box-shadow: inset 0 0 0 1px var(--fds-semantic-border-danger-default); } diff --git a/packages/react/src/components/form/Textarea/Textarea.tsx b/packages/react/src/components/form/Textarea/Textarea.tsx index 898abd6551..21d5de11b7 100644 --- a/packages/react/src/components/form/Textarea/Textarea.tsx +++ b/packages/react/src/components/form/Textarea/Textarea.tsx @@ -83,6 +83,7 @@ export const Textarea = forwardRef( classes.formField, textareaProps.disabled && classes.disabled, readOnly && classes.readonly, + hasError && classes.error, className, )} >