Skip to content

Commit 983a442

Browse files
samejrcursoragent
andcommitted
fix(webapp): defer login form validation to submit
Switch conform shouldValidate from onBlur to onSubmit so autofocused email fields don't flash an error when blurred or on back navigation. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent d99a4c4 commit 983a442

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

apps/webapp/app/routes/login._index/route.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export default function LoginPage() {
172172
onValidate({ formData }) {
173173
return parseWithZod(formData, { schema: emailSchema });
174174
},
175-
shouldValidate: "onBlur",
175+
shouldValidate: "onSubmit",
176176
shouldRevalidate: "onInput",
177177
});
178178

apps/webapp/app/routes/login.sso/route.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export default function LoginSsoPage() {
117117
onValidate({ formData }) {
118118
return parseWithZod(formData, { schema: ssoEmailSchema });
119119
},
120-
shouldValidate: "onBlur",
120+
shouldValidate: "onSubmit",
121121
shouldRevalidate: "onInput",
122122
});
123123

0 commit comments

Comments
 (0)