Skip to content

The new form helper #429

Answered by claudiodekker
captenmasin asked this question in Help
Discussion options

You must be logged in to vote

Hi,

That's correct. Inertia's first-party form does not have resetOnSuccess, as it caused a lot of issues amongst some our users, as well as that we considered it to be a somewhat counter-intuitive feature. Here's why: When an Inertia request finishes, Inertia's state is already updated automatically. Because of this, 'resetting' it on success wouldn't do anything, because the values you've entered are already in the 'target' state!

Of course, there are exclusions to this, such as a 'change password' form: When the request succeeds, you want to clear any password the user might have entered. For this reason, we have this.form.reset() / this.form.reset(field, field2, ...), which you can si…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@captenmasin
Comment options

Answer selected by captenmasin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants