Skip to content

Commit

Permalink
fix: active label by type
Browse files Browse the repository at this point in the history
  • Loading branch information
astagi committed Dec 6, 2023
1 parent 95e23a2 commit 0d01a3b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export const Input = ({
// Styling
const { activeClass, validationTextClass, inputClasses, wrapperClass } = getClasses(
className,
type,
{
valid,
invalid,
Expand Down
1 change: 1 addition & 0 deletions src/Input/TextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const TextArea = ({
// Styling
const { activeClass, validationTextClass, inputClasses, wrapperClass } = getClasses(
className,
'textarea',
{
valid,
invalid,
Expand Down
3 changes: 2 additions & 1 deletion src/Input/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ type InputClassesParams = ValidationProps &

export function getClasses(
className: string | undefined,
type: string,
{
isFocused,
valid,
Expand Down Expand Up @@ -126,7 +127,7 @@ export function getClasses(

const activeClass = mapToCssModules(
classNames({
active: isFocused || placeholder || value
active: isFocused || placeholder || value || ['date', 'time'].includes(type)
}),
cssModule
);
Expand Down

0 comments on commit 0d01a3b

Please sign in to comment.