-
-
Notifications
You must be signed in to change notification settings - Fork 513
Open
Labels
Description
Describe the bug
When handleSubmit
is called while canSubmit
is false
an early return is hit and onSubmitInvalid
is not called.
form/packages/form-core/src/FormApi.ts
Line 1918 in 1e58e57
if (!this.state.canSubmit) return |
Your minimal, reproducible example
https://stackblitz.com/edit/tanstack-form-dqy8vhes?file=src%2Findex.tsx
Steps to reproduce
- Go to the Stackblitz
- 👁️ Observe:
"canSubmit": false,
(see JSON-dump in<pre>
-Tag) - Click the Submit Button
- 👁️ Observe: No
console.log
for"onSubmitInvalid"
Expected behavior
As a User I expect form.onSubmitInvalid
to be called whenever the form is submitted in an invalid state
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
irrelevant
TanStack Form adapter
react-form
TanStack Form version
1.19.2
TypeScript version
No response
Additional context
No response