-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
bugSomething isn't workingSomething isn't workingformsStuff relating to forms and form actionsStuff relating to forms and form actionsp2-nice-to-haveSvelteKit cannot be used by a small number of people, quality of life improvements, etc.SvelteKit cannot be used by a small number of people, quality of life improvements, etc.
Description
Describe the bug
Without an argument,
use:enhancewill emulate the browser-native behaviour, just without the full-page reloads.
Native browser behaviour clears form inputs after submit (or rather the associated page reload does that).
The progressively enhanced forms do not. This would require resetting the form in the enhance callback. This works:
<form
method="post"
action="?/doSomething"
use:enhance={({ form }) => {
return async ({ update }) => {
form.reset();
await update();
};
}}
>But is still a hassle.
Reproduction
This applies to all SvelteKit installs.
Logs
No response
System Info
System:
OS: macOS 12.6
CPU: (10) arm64 Apple M1 Pro
Memory: 7.58 GB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.9.0 - ~/.nvm/versions/node/v18.9.0/bin/node
npm: 8.19.1 - ~/.nvm/versions/node/v18.9.0/bin/npm
Browsers:
Chrome: 105.0.5195.125
Firefox: 105.0.1
Safari: 16.0
npmPackages:
@sveltejs/adapter-auto: ^1.0.0-next.76 => 1.0.0-next.80
@sveltejs/adapter-node: ^1.0.0-next.96 => 1.0.0-next.96
@sveltejs/adapter-vercel: ^1.0.0-next.77 => 1.0.0-next.77
@sveltejs/kit: ^1.0.0-next.489 => 1.0.0-next.507
svelte: ^3.50.1 => 3.50.1
vite: ^3.1.4 => 3.1.4Severity
annoyance
Additional Information
No response
ZetiMente and liborvanek
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingformsStuff relating to forms and form actionsStuff relating to forms and form actionsp2-nice-to-haveSvelteKit cannot be used by a small number of people, quality of life improvements, etc.SvelteKit cannot be used by a small number of people, quality of life improvements, etc.