Skip to content

submitting with subscription stuck in true #875

@nfantone

Description

@nfantone

Are you submitting a bug report or a feature request?

Bug report.

What is the current behavior?

If setting subscription, under certain circumstances which seem to be related to the time the submit callback takes to complete, form.submitting is not reset. It will stay true even after the onSubmit async callback resolves.

What is the expected behavior?

form.submitting should always flip back to false when the promise-returning or async onSubmit callback resolves.

Sandbox Link

  • Take any of the examples on the website, like this one.
  • Comment the await sleep(300); call on L:10.
  • Try submitting any values with both forms shown.
  • Notice the difference between the top and bottom forms: "Submit" button on second form will remain disabled due to submitting.
  • Re-adding the await sleep(300) call makes the behaviour go back to normal.

What's your environment?

  • react-final-form: 6.5.2
  • final-form: 4.20.1
  • react: 17.0.1
  • nodejs: v14.15.0

Running on macOS Catalina 10.15.7 (19H2).

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