form
form copied to clipboard
bug(nextjs): formApi.handleSubmit isn't trigerred
Describe the bug
Reading through https://tanstack.com/form/latest/docs/framework/react/guides/listeners#form-listeners, I tried to implement the auto-save functionality. The onChange is being triggered but the submit method doesn't trigger the action attached to the form (not calling the server).
Your minimal, reproducible example
https://tanstack.com/form/latest/docs/framework/react/guides/listeners#form-listeners
Steps to reproduce
- https://tanstack.com/form/latest/docs/framework/react/guides/ssr#using-tanstack-form-in-a-nextjs-app-router
- Implement the auto-save feature instead of the submit button
Expected behavior
The action is being triggered when the form is being submitted through the auto-save with the listeners.onChange debounce.
How often does this bug happen?
None
Screenshots or Videos
No response
Platform
MacOS, Chrome
TanStack Form adapter
None
TanStack Form version
1.11.1
TypeScript version
No response
Additional context
No response
I found out that this is triggering the onSubmit method from the useForm, which is on the client-side.