Skip to content

useForm processing and progress should only be reset in onFinish #2463

@mattwigham

Description

@mattwigham

Inertia adapter(s) affected

  • React
  • Vue 3
  • Svelte
  • Not Applicable

JS package version

2.0.x

Backend stack (optional)

No response

Describe the problem

Currently the form helper's onSuccess, onError, onCancel, and onFinish callbacks all set processing = false and progress = null. I'm sure this was done for a reason, but I'm suggesting it only be called in onFinish.

Aside from the pedantic and DRY reasons to do this, this also helps those of us using the feature of onSuccess and onError where you can return a promise, and onFinish won't be called until it resolves.

I'm using that feature in some forms that do work in a background job, which I poll the status of inside the promise, and it'd be nice if the form's processing was true during that entire time and not just the initial submission.

Steps to reproduce

n/a

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