mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-21 12:28:46 +00:00
fix(login): use onChange instead of onBlur with react-hook-form (#11354)
# Which Problems Are Solved Fixes a problem where submit buttons where not correctly enabled onBlur event # How the Problems Are Solved By changing the react-hook-form mode property to onChange, buttons are enabled as intended
This commit is contained in:
@@ -25,18 +25,11 @@ type Props = {
|
||||
requestId?: string;
|
||||
};
|
||||
|
||||
export function VerifyForm({
|
||||
userId,
|
||||
loginName,
|
||||
organization,
|
||||
requestId,
|
||||
code,
|
||||
isInvite,
|
||||
}: Props) {
|
||||
export function VerifyForm({ userId, loginName, organization, requestId, code, isInvite }: Props) {
|
||||
const router = useRouter();
|
||||
|
||||
const { register, handleSubmit, formState } = useForm<Inputs>({
|
||||
mode: "onBlur",
|
||||
mode: "onChange",
|
||||
defaultValues: {
|
||||
code: code ?? "",
|
||||
},
|
||||
@@ -73,9 +66,7 @@ export function VerifyForm({
|
||||
}
|
||||
|
||||
const fcn = useCallback(
|
||||
async function submitCodeAndContinue(
|
||||
value: Inputs,
|
||||
): Promise<boolean | void> {
|
||||
async function submitCodeAndContinue(value: Inputs): Promise<boolean | void> {
|
||||
setLoading(true);
|
||||
|
||||
const response = await sendVerification({
|
||||
|
||||
Reference in New Issue
Block a user