fix: uncontrolled input to controlled in SigninUpForm (#8536)

Fixes: #8535

---------

Co-authored-by: Devessier <baptiste@devessier.fr>
This commit is contained in:
Harsh Singh 2024-11-19 18:43:35 +05:30 committed by GitHub
parent 0d0f7e67a6
commit 86c2e9f0e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 10 deletions

View File

@ -1,14 +1,4 @@
import { FooterNote } from '@/auth/sign-in-up/components/FooterNote'; import { FooterNote } from '@/auth/sign-in-up/components/FooterNote';
import {
HorizontalSeparator,
ActionLink,
IconGoogle,
IconKey,
IconMicrosoft,
Loader,
MainButton,
StyledText,
} from 'twenty-ui';
import { useHandleResetPassword } from '@/auth/sign-in-up/hooks/useHandleResetPassword'; import { useHandleResetPassword } from '@/auth/sign-in-up/hooks/useHandleResetPassword';
import { SignInUpMode, useSignInUp } from '@/auth/sign-in-up/hooks/useSignInUp'; import { SignInUpMode, useSignInUp } from '@/auth/sign-in-up/hooks/useSignInUp';
import { import {
@ -29,6 +19,16 @@ import { useMemo, useState } from 'react';
import { Controller } from 'react-hook-form'; import { Controller } from 'react-hook-form';
import { useRecoilState, useRecoilValue } from 'recoil'; import { useRecoilState, useRecoilValue } from 'recoil';
import { Key } from 'ts-key-enum'; import { Key } from 'ts-key-enum';
import {
ActionLink,
HorizontalSeparator,
IconGoogle,
IconKey,
IconMicrosoft,
Loader,
MainButton,
StyledText,
} from 'twenty-ui';
import { isDefined } from '~/utils/isDefined'; import { isDefined } from '~/utils/isDefined';
const StyledContentContainer = styled.div` const StyledContentContainer = styled.div`

View File

@ -25,6 +25,9 @@ export const useSignInUpForm = () => {
mode: 'onChange', mode: 'onChange',
defaultValues: { defaultValues: {
exist: false, exist: false,
email: '',
password: '',
captchaToken: '',
}, },
resolver: zodResolver(validationSchema), resolver: zodResolver(validationSchema),
}); });