From fb773c9161bf8faa5ebd7e115f3564c3359e56ea Mon Sep 17 00:00:00 2001
From: Martin Trapp <94928215+martrapp@users.noreply.github.com>
Date: Tue, 27 Feb 2024 18:16:32 +0100
Subject: [PATCH] Removes morph animations when setting transition:animate=none
(#10247)
* Removes morph animations when setting transition:animate=none
* Apply suggestions from code review
---------
Co-authored-by: Arsh <69170106+lilnasy@users.noreply.github.com>
---
.changeset/eight-shrimps-enjoy.md | 5 +++++
packages/astro/src/runtime/server/transition.ts | 1 +
2 files changed, 6 insertions(+)
create mode 100644 .changeset/eight-shrimps-enjoy.md
diff --git a/.changeset/eight-shrimps-enjoy.md b/.changeset/eight-shrimps-enjoy.md
new file mode 100644
index 000000000000..a56edf543021
--- /dev/null
+++ b/.changeset/eight-shrimps-enjoy.md
@@ -0,0 +1,5 @@
+---
+"astro": patch
+---
+
+Fixes an issue where `` still allowed the browser-native morph animation.
diff --git a/packages/astro/src/runtime/server/transition.ts b/packages/astro/src/runtime/server/transition.ts
index 025da64e867a..6514c1e91272 100644
--- a/packages/astro/src/runtime/server/transition.ts
+++ b/packages/astro/src/runtime/server/transition.ts
@@ -107,6 +107,7 @@ export function renderTransition(
sheet.addFallback('old', 'animation: none; mix-blend-mode: normal;');
sheet.addModern('old', 'animation: none; opacity: 0; mix-blend-mode: normal;');
sheet.addAnimationRaw('new', 'animation: none; mix-blend-mode: normal;');
+ sheet.addModern('group', 'animation: none');
}
result._metadata.extraHead.push(markHTMLString(``));