@@ -31,6 +31,7 @@ const DELAY_NEXT_TICK = Number.MIN_SAFE_INTEGER;
31
31
32
32
/** @type {undefined | number } */
33
33
let active_tick_ref = undefined ;
34
+ let skip_mount_intro = false ;
34
35
35
36
/**
36
37
* @template T
@@ -482,7 +483,6 @@ export function bind_transition(dom, get_transition_fn, props_fn, direction, glo
482
483
// @ts -ignore
483
484
dom . __animate = true ;
484
485
}
485
- let foo = false ;
486
486
/** @type {import('./types.js').Block | null } */
487
487
let transition_block = block ;
488
488
main: while ( transition_block !== null ) {
@@ -496,7 +496,7 @@ export function bind_transition(dom, get_transition_fn, props_fn, direction, glo
496
496
can_show_intro_on_mount = true ;
497
497
} else if ( transition_block . t === IF_BLOCK ) {
498
498
transition_block . r = if_block_transition ;
499
- if ( can_show_intro_on_mount ) {
499
+ if ( can_show_intro_on_mount && ! skip_mount_intro ) {
500
500
/** @type {import('./types.js').Block | null } */
501
501
let if_block = transition_block ;
502
502
while ( if_block . t === IF_BLOCK ) {
@@ -511,14 +511,14 @@ export function bind_transition(dom, get_transition_fn, props_fn, direction, glo
511
511
}
512
512
}
513
513
if ( ! can_apply_lazy_transitions && can_show_intro_on_mount ) {
514
- can_show_intro_on_mount = transition_block . e !== null ;
515
- foo = true ;
514
+ can_show_intro_on_mount = ! skip_mount_intro && transition_block . e !== null ;
516
515
}
517
516
if ( can_show_intro_on_mount || ! global ) {
518
517
can_apply_lazy_transitions = true ;
519
518
}
520
519
} else if ( transition_block . t === ROOT_BLOCK && ! can_apply_lazy_transitions ) {
521
- can_show_intro_on_mount = transition_block . e !== null || transition_block . i ;
520
+ can_show_intro_on_mount =
521
+ ! skip_mount_intro && ( transition_block . e !== null || transition_block . i ) ;
522
522
}
523
523
transition_block = transition_block . p ;
524
524
}
@@ -529,7 +529,12 @@ export function bind_transition(dom, get_transition_fn, props_fn, direction, glo
529
529
effect ( ( ) => {
530
530
if ( transition !== undefined ) {
531
531
// Destroy any existing transitions first
532
- transition . x ( ) ;
532
+ try {
533
+ skip_mount_intro = true ;
534
+ transition . x ( ) ;
535
+ } finally {
536
+ skip_mount_intro = false ;
537
+ }
533
538
}
534
539
const transition_fn = get_transition_fn ( ) ;
535
540
/** @param {DOMRect } [from] */
0 commit comments