-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Description
Describe the bug
SvelteKit's "automatic form reset after remote form submission" should do a full reset including touched states.
Existing issues request APIs to do this:
- Add a
clearandresetmethods to theformremote function #14210 - remote form: resetting form does not clear validation errors and does not reset touched state #14754
But I really hope this becomes the SvelteKit's default:
Currently, using oninput or onchange for validation shows incorrect messages in consecutive form submissions.
Reproduction
For some reason, I can only reproduce this in Firefox. All password manager extensions were disabled.
2025-12-28.212538.mp4
https://github.com/hyunbinseo/svelte-kit-15103
- Focus the email input
- Enter a valid value and press
Enterto submit - The form is automatically reset (reference)
- Click outside the input to trigger
onchange - The following validation error is shown:
Invalid email: Received ""
<script lang="ts">
import { PublicSchema } from './form';
import { submitEmail } from './form.remote';
</script>
<form
{...submitEmail.preflight(PublicSchema)}
onchange={() => submitEmail.validate({ preflightOnly: true })}
>
<label>
<span>Email</span>
<input {...submitEmail.fields.email.as('email')} />
</label>
<ul>
{#each submitEmail.fields.email.issues() as issue}
<li>{issue.message}</li>
{/each}
</ul>
<button>Submit</button>
</form>Logs
System Info
System:
OS: Windows 11 10.0.26200
CPU: (8) x64 Intel(R) Core(TM) Ultra 7 258V
Memory: 6.82 GB / 31.48 GB
Binaries:
Node: 24.12.0 - C:\Users\hyunb\AppData\Local\fnm_multishells\32780_1766922545167\node.EXE
Yarn: 1.22.22 - C:\Users\hyunb\AppData\Local\fnm_multishells\32780_1766922545167\yarn.CMD
npm: 11.6.2 - C:\Users\hyunb\AppData\Local\fnm_multishells\32780_1766922545167\npm.CMD
pnpm: 10.26.2 - C:\Users\hyunb\AppData\Local\fnm_multishells\32780_1766922545167\pnpm.CMD
Deno: 2.4.0 - C:\Users\hyunb\.deno\bin\deno.EXE
Browsers:
Chrome: 143.0.7499.170
Edge: Chromium (140.0.3485.54)
Firefox: 146.0.1 - C:\Program Files\Mozilla Firefox\firefox.exe
npmPackages:
@sveltejs/adapter-auto: ^7.0.0 => 7.0.0
@sveltejs/kit: ^2.49.2 => 2.49.2
@sveltejs/vite-plugin-svelte: ^6.2.1 => 6.2.1
svelte: ^5.46.0 => 5.46.1
vite: ^7.3.0 => 7.3.0Severity
annoyance
Additional Information
No response
Metadata
Metadata
Assignees
Labels
No labels