Skip to content

Commit 249d52a

Browse files
authored
Extend the simulated viewTransition object with the property (#13381)
1 parent 61ba332 commit 249d52a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/every-birds-stick.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'astro': patch
3+
---
4+
5+
Adds the `types` property to the viewTransition object when the ClientRouter simulates parts of the View Transition API on browsers w/o native support.

packages/astro/src/transitions/router.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,6 @@ async function transition(
508508
//
509509
// "finished" resolves after all animations are done.
510510

511-
// @ts-expect-error the internal type `types` isn't provided and not even documented on MDN
512511
currentTransition.viewTransition = {
513512
updateCallbackDone: updateDone, // this is about correct
514513
ready: updateDone, // good enough
@@ -520,6 +519,7 @@ async function transition(
520519
// This cancels all animations of the simulation
521520
document.documentElement.removeAttribute(OLD_NEW_ATTR);
522521
},
522+
types: new Set<string>(), // empty by default
523523
};
524524
}
525525
// In earlier versions was then'ed on viewTransition.ready which would not execute

0 commit comments

Comments
 (0)