-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add submitting state to page store #7120
Copy link
Copy link
Closed as not planned
Description
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?- and so on
<script>
import { page } from '$app/store'
</script>
<button disable={$page.formSubmitting}>submit</button>Alternatives considered
No response
Importance
nice to have
Additional Information
FYI: Remix can handle it by the followings,
function SubmitButton() {
const transition = useTransition();
return <button type="submit" disable={transition.state === "submitting"}>submit</button>;
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels