Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
melkir opened this issue May 12, 2025 · 1 comment
Open

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

melkir opened this issue May 12, 2025 · 1 comment

Comments

@melkir
Copy link

melkir commented May 12, 2025

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
Copy link
Author

melkir commented May 14, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant