-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add submitting
state to page
store
#7120
Comments
but what if there is multiple forms in a page? |
Good point of view. I had missed it. Thank you! Current SvelteKit already has |
<script>
import { enhance } from '$app/forms';
let submitting = false;
</script>
<form method="POST" use:enhance={() => {
submitting = true;
return ({ update }) => {
submitting = false;
update();
}
}}>
...
</form> I think the bigger desire here is to have more info and/or a provided function to make these more advanced uses cases (multiple in-flight submissions, submission state) easy to implement. I opened #7175 for this, closing in favor of that. |
Describe the problem
First, thank you for all of your work in SvelteKit.
It's common to disable the submit button during form submission to prevent users from submitting multiple times.
But now, we need some boilerplate code to do it. cf) #7041
It would be nice if SvelteKit provides the submitting state by
page
store.Describe the proposed solution
$page.formSubmitting
?$page.form.submitting
?Alternatives considered
No response
Importance
nice to have
Additional Information
FYI: Remix can handle it by the followings,
https://remix.run/docs/en/v1/api/remix#transitionstate
The text was updated successfully, but these errors were encountered: