From 238bb55ec3ed502f26dd70ab80d46e51c9d51a61 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Tue, 28 Nov 2023 17:59:54 -0600 Subject: [PATCH] feat(view-transitions): enable form submission handling by default --- .changeset/odd-rivers-happen.md | 5 ++ .../astro/components/ViewTransitions.astro | 55 ++++++++++--------- 2 files changed, 33 insertions(+), 27 deletions(-) create mode 100644 .changeset/odd-rivers-happen.md diff --git a/.changeset/odd-rivers-happen.md b/.changeset/odd-rivers-happen.md new file mode 100644 index 000000000000..2490084bc234 --- /dev/null +++ b/.changeset/odd-rivers-happen.md @@ -0,0 +1,5 @@ +--- +'astro': major +--- + +Removes the opt-in `handleForms` property for ``. Form submissions are now handled by default and can be disabled by setting `data-astro-reload` on relevant `
` elements. diff --git a/packages/astro/components/ViewTransitions.astro b/packages/astro/components/ViewTransitions.astro index 1fa3611ddbb9..934ae650f39a 100644 --- a/packages/astro/components/ViewTransitions.astro +++ b/packages/astro/components/ViewTransitions.astro @@ -3,10 +3,14 @@ type Fallback = 'none' | 'animate' | 'swap'; export interface Props { fallback?: Fallback; + /** @deprecated handleForms is enabled by default in Astro 4.0 + * + * Set `data-astro-reload` on your form to opt-out of the default behavior. + */ handleForms?: boolean; } -const { fallback = 'animate', handleForms } = Astro.props; +const { fallback = 'animate' } = Astro.props; --- -{handleForms ? : ''}