0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-03-10 23:01:26 -05:00

Extend the simulated viewTransition object with the property (#13381)

This commit is contained in:
Martin Trapp 2025-03-10 11:48:50 +01:00 committed by GitHub
parent 61ba33283b
commit 249d52a3ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -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.

View file

@ -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