summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.changeset/every-birds-stick.md5
-rw-r--r--packages/astro/src/transitions/router.ts2
2 files changed, 6 insertions, 1 deletions
diff --git a/.changeset/every-birds-stick.md b/.changeset/every-birds-stick.md
new file mode 100644
index 000000000..fe9ea7890
--- /dev/null
+++ b/.changeset/every-birds-stick.md
@@ -0,0 +1,5 @@
+---
+'astro': patch
+---
+
+Adds the `types` property to the viewTransition object when the ClientRouter simulates parts of the View Transition API on browsers w/o native support.
diff --git a/packages/astro/src/transitions/router.ts b/packages/astro/src/transitions/router.ts
index 0af04940a..27f7ca6ba 100644
--- a/packages/astro/src/transitions/router.ts
+++ b/packages/astro/src/transitions/router.ts
@@ -508,7 +508,6 @@ async function transition(
//
// "finished" resolves after all animations are done.
- // @ts-expect-error the internal type `types` isn't provided and not even documented on MDN
currentTransition.viewTransition = {
updateCallbackDone: updateDone, // this is about correct
ready: updateDone, // good enough
@@ -520,6 +519,7 @@ async function transition(
// This cancels all animations of the simulation
document.documentElement.removeAttribute(OLD_NEW_ATTR);
},
+ types: new Set<string>(), // empty by default
};
}
// In earlier versions was then'ed on viewTransition.ready which would not execute