From 0d01a3bf9608070a50df2a0ef1db986866ed5bfc Mon Sep 17 00:00:00 2001 From: Andrea Stagi Date: Wed, 6 Dec 2023 16:33:52 +0100 Subject: [PATCH] fix: active label by type --- src/Input/Input.tsx | 1 + src/Input/TextArea.tsx | 1 + src/Input/utils.tsx | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Input/Input.tsx b/src/Input/Input.tsx index 8ba25e6bf..b907694f9 100644 --- a/src/Input/Input.tsx +++ b/src/Input/Input.tsx @@ -187,6 +187,7 @@ export const Input = ({ // Styling const { activeClass, validationTextClass, inputClasses, wrapperClass } = getClasses( className, + type, { valid, invalid, diff --git a/src/Input/TextArea.tsx b/src/Input/TextArea.tsx index e4a94289b..c5d4c3a19 100644 --- a/src/Input/TextArea.tsx +++ b/src/Input/TextArea.tsx @@ -68,6 +68,7 @@ export const TextArea = ({ // Styling const { activeClass, validationTextClass, inputClasses, wrapperClass } = getClasses( className, + 'textarea', { valid, invalid, diff --git a/src/Input/utils.tsx b/src/Input/utils.tsx index 0fbcc28c8..3e20c58b9 100644 --- a/src/Input/utils.tsx +++ b/src/Input/utils.tsx @@ -64,6 +64,7 @@ type InputClassesParams = ValidationProps & export function getClasses( className: string | undefined, + type: string, { isFocused, valid, @@ -126,7 +127,7 @@ export function getClasses( const activeClass = mapToCssModules( classNames({ - active: isFocused || placeholder || value + active: isFocused || placeholder || value || ['date', 'time'].includes(type) }), cssModule );