Skip to content

Commit 702d7ba

Browse files
committed
cleanup
1 parent 5d0ce2f commit 702d7ba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/svelte/src/internal/client/transitions.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ function is_transition_block(block) {
424424
export function bind_transition(dom, get_transition_fn, props_fn, direction, global) {
425425
const transition_effect = /** @type {import('./types.js').EffectSignal} */ (current_effect);
426426
const block = current_block;
427+
const is_key_animation = direction === 'key';
427428

428429
let can_show_intro_on_mount = true;
429430
let can_apply_lazy_transitions = false;
@@ -471,7 +472,7 @@ export function bind_transition(dom, get_transition_fn, props_fn, direction, glo
471472
const init = (from) =>
472473
untrack(() => {
473474
const props = props_fn === null ? {} : props_fn();
474-
return direction === 'key'
475+
return is_key_animation
475476
? /** @type {import('./types.js').AnimateFn<any>} */ (transition_fn)(
476477
dom,
477478
{ from: /** @type {DOMRect} */ (from), to: dom.getBoundingClientRect() },
@@ -495,7 +496,7 @@ export function bind_transition(dom, get_transition_fn, props_fn, direction, glo
495496
destroy_signal(effect);
496497
dom.inert = false;
497498

498-
if (transition.p === null) {
499+
if (transition.p === null && !is_key_animation) {
499500
return;
500501
}
501502

0 commit comments

Comments
 (0)