From 88ab1093243ee77e2a0455e81ec3e22a877a5dcb Mon Sep 17 00:00:00 2001 From: Harry Allen <66224939+HarryAllen1@users.noreply.github.com> Date: Sun, 15 Dec 2024 23:21:04 -0800 Subject: [PATCH] docs: avoid legacy Svelte syntax (#13166) * avoid invalid svelte syntax * type submit event correctly --------- Co-authored-by: Harry Allen <66224939+MajesticString@users.noreply.github.com> --- documentation/docs/20-core-concepts/30-form-actions.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/documentation/docs/20-core-concepts/30-form-actions.md b/documentation/docs/20-core-concepts/30-form-actions.md index 74d08c9fdc15..26b74d90fae2 100644 --- a/documentation/docs/20-core-concepts/30-form-actions.md +++ b/documentation/docs/20-core-concepts/30-form-actions.md @@ -430,8 +430,9 @@ We can also implement progressive enhancement ourselves, without `use:enhance`, /** @type {{ form: import('./$types').ActionData }} */ let { form } = $props(); - /** @param {{ currentTarget: EventTarget & HTMLFormElement}} event */ + /** @param {SubmitEvent & { currentTarget: EventTarget & HTMLFormElement}} event */ async function handleSubmit(event) { + event.preventDefault(); const data = new FormData(event.currentTarget); const response = await fetch(event.currentTarget.action, { @@ -451,7 +452,7 @@ We can also implement progressive enhancement ourselves, without `use:enhance`, } -
+
```