Skip to content

Commit

Permalink
fix: year input format
Browse files Browse the repository at this point in the history
  • Loading branch information
mani1911 committed Jan 3, 2024
1 parent 2641cb3 commit e4dbff2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/AuthLayout/signup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const SignUp: React.FC<SignupFormProps> = ({ setForm }) => {
userState: '',
userPhno: '',
userDegree: 'BTech',
userYear: 2026,
userYear: 2016,
userCollege: 'Other',
userOtherCollege: '',
userCity: '',
Expand All @@ -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 e4dbff2

Please sign in to comment.