final-form / final-form/react-final-form

Bug: Submitting seems to get stuck as `true`

Open
#903 6 comments 3 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.4k
Forks
497
PR merge metrics
No merged PRs in 30d

Description

### Are you submitting a **bug report** or a **feature request**?

Bug report

### What is the current behavior?

Example repo: https://codesandbox.io/s/dreamy-goodall-cvy9c?file=/index.js

Seems that, if `handleSubmit` returns `Promis` without causing an async tick, submission gets stuck in `submitting: true` state.

### What is the expected behavior?

Shouldn't be stuck in submitting; should briefly be `submitting: true` then switch back to false

### Sandbox Link

https://codesandbox.io/s/dreamy-goodall-cvy9c?file=/index.js

### What's your environment?

Latest final-form/rff

### Other information

Hey Erik! 👋 I'll try to dig in at root cause. I have some free time :)

Contributor guide

Open the contributing guide

Research direction

Reproduce the behavior in the linked CodeSandbox, starting at the handleSubmit implementation and observing the submitting state when it returns Promise without an async tick. Trace the submission lifecycle in the project and verify that submitting briefly becomes true and then returns to false for this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.