diff --git a/src/components/TextareaField/TextareaField-v2.module.css b/src/components/TextareaField/TextareaField-v2.module.css index 61c00db81..07ec52c6b 100644 --- a/src/components/TextareaField/TextareaField-v2.module.css +++ b/src/components/TextareaField/TextareaField-v2.module.css @@ -13,6 +13,11 @@ .textarea { @mixin inputStylesV2; padding: 0.5rem 0.75rem; + + &:read-only:not(:disabled) { + border: 0; + border-bottom: 1px solid var(--eds-theme-color-border-utility-default-low-emphasis); + } } /** diff --git a/src/components/TextareaField/TextareaField-v2.tsx b/src/components/TextareaField/TextareaField-v2.tsx index 3e5c66c67..24dafd662 100644 --- a/src/components/TextareaField/TextareaField-v2.tsx +++ b/src/components/TextareaField/TextareaField-v2.tsx @@ -217,6 +217,10 @@ export const TextareaField: TextareaFieldType = forwardRef( styles['textarea-field--invalid-length'], ); + const textareaClassName = clsx( + readOnly && styles['textarea-field__textarea--read-only'], + ); + // Pick the smallest of the lengths to set as the maximum value allowed const maxLengthShown = getMinValue(maxLength, recommendedMaxLength); @@ -247,11 +251,18 @@ export const TextareaField: TextareaFieldType = forwardRef( (Optional) )} + {maxLengthShown && ( +