Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Cannot resubmit the form when there is a submit error #1105

@depsimon

Description

@depsimon

Describe the bug

I am trying to hook API Errors with @tanstack/form.

I thought I could set the error in an ErrorMap on the onSubmit key as it revalidates when the form is actually submitted, but I guess I'm missing something.

Your minimal, reproducible example

https://codesandbox.io/p/sandbox/qg7yvw

Steps to reproduce

  1. Click the Login button
  2. Notice the API Error which comes from some API Error
  3. canSubmit is now false and there is no way to submit the form again without changing a value of any input.

Expected behavior

I expect to be able to submit the form when it has an onSubmit error so that it can be re-validated by the submission.

This error comes from something that might not be related to the form values itself (i.e. a Network Error or an other error during the process of the request even if the fields are valid). I still want to add the error to the form errors, but be able to re-submit immediately.

How often does this bug happen?

None

Screenshots or Videos

No response

Platform

  • MacOS
  • Arc

TanStack Form adapter

react-form

TanStack Form version

v0.41.0

TypeScript version

No response

Additional context

No response

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