File tree Expand file tree Collapse file tree
packages/astro/src/transitions Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " astro " : patch
3+ ---
4+
5+ Fixes a timing issue in the view transition simulation.
Original file line number Diff line number Diff line change @@ -396,8 +396,10 @@ async function updateDOM(
396396 const style = window . getComputedStyle ( effect . target , effect . pseudoElement ) ;
397397 return style . animationIterationCount === 'infinite' ;
398398 }
399- // Trigger the animations
400399 const currentAnimations = document . getAnimations ( ) ;
400+ // allow animations triggered by viewTransition.ready to start
401+ await new Promise < void > ( ( r ) => setTimeout ( r ) ) ;
402+ // Trigger view transition animations waiting for data-astro-transition-fallback
401403 document . documentElement . setAttribute ( OLD_NEW_ATTR , phase ) ;
402404 const nextAnimations = document . getAnimations ( ) ;
403405 const newAnimations = nextAnimations . filter (
You can’t perform that action at this time.
0 commit comments