Skip to content

Commit

Permalink
fix: input type (#28)
Browse files Browse the repository at this point in the history
* fix: year input format

* fix: inital year

---------

Co-authored-by: mani1911 <[email protected]>
  • Loading branch information
mani1911 and mani1911 authored Jan 4, 2024
1 parent 2641cb3 commit fb0400c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/AuthLayout/signup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const SignUp: React.FC<SignupFormProps> = ({ setForm }) => {
userVoucherName: '',
});

const handleFormFields = (field: string, value: string | null): void => {
const handleFormFields = (field: string, value: string | null | number): void => {
setRegisterForm(form => ({ ...form, [field]: value }));
};
const handleCaptchaSubmission = (token: string | null) => {
Expand Down Expand Up @@ -321,7 +321,10 @@ export const SignUp: React.FC<SignupFormProps> = ({ setForm }) => {
wrapperClassName={styles.signupFields}
initialValue={registerForm.userYear}
onChange={e => {
handleFormFields('userYear', e.target.value);
handleFormFields(
'userYear',
e.target.value.length === 0 ? 0 : parseInt(e.target.value),
);
}}
/>
<FormInput
Expand Down

0 comments on commit fb0400c

Please sign in to comment.