From e4dbff243b874774a9c9dc4e71614c1dc00d94fe Mon Sep 17 00:00:00 2001 From: mani1911 Date: Thu, 4 Jan 2024 00:13:02 +0530 Subject: [PATCH] fix: year input format --- src/components/AuthLayout/signup.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/AuthLayout/signup.tsx b/src/components/AuthLayout/signup.tsx index 55ba6e8..d83534e 100644 --- a/src/components/AuthLayout/signup.tsx +++ b/src/components/AuthLayout/signup.tsx @@ -40,7 +40,7 @@ export const SignUp: React.FC = ({ setForm }) => { userState: '', userPhno: '', userDegree: 'BTech', - userYear: 2026, + userYear: 2016, userCollege: 'Other', userOtherCollege: '', userCity: '', @@ -51,7 +51,7 @@ export const SignUp: React.FC = ({ 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) => { @@ -321,7 +321,10 @@ export const SignUp: React.FC = ({ 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), + ); }} />