Describe the bug
When handleSubmit is called while canSubmit is false an early return is hit and onSubmitInvalid is not called.
|
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
Describe the bug
When
handleSubmitis called whilecanSubmitisfalsean early return is hit andonSubmitInvalidis not called.form/packages/form-core/src/FormApi.ts
Line 1918 in 1e58e57
Your minimal, reproducible example
https://stackblitz.com/edit/tanstack-form-dqy8vhes?file=src%2Findex.tsx
Steps to reproduce
"canSubmit": false,(see JSON-dump in<pre>-Tag)console.logfor"onSubmitInvalid"Expected behavior
As a User I expect
form.onSubmitInvalidto be called whenever the form is submitted in an invalid stateHow 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