Skip to content

Commit

Permalink
fix: form validation (#431)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zir0h authored Nov 15, 2024
1 parent 87d6bda commit b043b4f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/atoms/input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ function Input(

const handleInput = useCallback(
(e: React.FormEvent<HTMLInputElement>) => {
const target = e.target as HTMLInputElement;
onChange(e)
const target = e.target as HTMLInputElement
if (target) {
const v =
type === 'number'
Expand All @@ -91,8 +92,8 @@ function Input(
: target.value
: target.value;

setValue(v);
onChange(v);
setValue(v)
onChange(v)
}
},
[setValue, onChange, type]
Expand Down

0 comments on commit b043b4f

Please sign in to comment.