Skip to content

Regression: onSubmit can be invoked concurrently while a submission is in progress (v1.33.1) #2279

Description

@kthoring

Describe the bug

After upgrading to v1.33.1, it appears that onSubmit can be invoked multiple times while a previous submission is still pending.

In previous versions, clicking the submit button while a submission was already in progress would not invoke onSubmit again. After upgrading, each click results in another invocation of onSubmit, causing multiple concurrent submissions.

Your minimal, reproducible example

https://codesandbox.io/p/sandbox/nostalgic-brook-w68c8p

Steps to reproduce

  1. Click Submit.
  2. Before the 2-second onSubmit promise resolves, click Submit several more times.

Expected behavior

While a submission is in progress, subsequent clicks should not invoke onSubmit again. Only a single submission should be active at a time.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

  • OS: Windows
  • Browser: Firefox
  • Version: 154.0b7

TanStack Form adapter

react-form

TanStack Form version

1.33.1

TypeScript version

v6.0.3

Additional context

I believe this regression was introduced by #2120

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions