form icon indicating copy to clipboard operation
form copied to clipboard

bug(nextjs): formApi.handleSubmit isn't trigerred

Open melkir opened this issue 8 months ago • 1 comments

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

  1. https://tanstack.com/form/latest/docs/framework/react/guides/ssr#using-tanstack-form-in-a-nextjs-app-router
  2. 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

melkir avatar May 12 '25 09:05 melkir

I found out that this is triggering the onSubmit method from the useForm, which is on the client-side.

melkir avatar May 14 '25 15:05 melkir