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:
parent
61ba33283b
commit
249d52a3ff
2 changed files with 6 additions and 1 deletions
5
.changeset/every-birds-stick.md
Normal file
5
.changeset/every-birds-stick.md
Normal 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.
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue