Skip to content

Commit 12fa1c4

Browse files
committed
fix: When intro was triggered before the outro, that outro was canceled
1 parent 435d14a commit 12fa1c4

File tree

1 file changed

+2
-0
lines changed
  • src/compiler/compile/render_dom/wrappers/Element

1 file changed

+2
-0
lines changed

src/compiler/compile/render_dom/wrappers/Element/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,7 @@ export default class ElementWrapper extends Wrapper {
718718

719719
const intro_block = b`
720720
@add_render_callback(() => {
721+
if (!#current) return;
721722
if (!${name}) ${name} = @create_bidirectional_transition(${this.var}, ${fn}, ${snippet}, true);
722723
${name}.run(1);
723724
});
@@ -763,6 +764,7 @@ export default class ElementWrapper extends Wrapper {
763764
if (outro) {
764765
intro_block = b`
765766
@add_render_callback(() => {
767+
if (!#current) return;
766768
if (${outro_name}) ${outro_name}.end(1);
767769
${intro_name} = @create_in_transition(${this.var}, ${fn}, ${snippet});
768770
${intro_name}.start();

0 commit comments

Comments
 (0)