Skip to content

Commit 2bd3f26

Browse files
bfangerBob Fanger
authored and
Bob Fanger
committed
fix: When intro was triggered before the outro, that outro was canceled
1 parent 57d869d commit 2bd3f26

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
@@ -897,6 +897,7 @@ export default class ElementWrapper extends Wrapper {
897897

898898
const intro_block = b`
899899
@add_render_callback(() => {
900+
if (!#current) return;
900901
if (!${name}) ${name} = @create_bidirectional_transition(${this.var}, ${fn}, ${snippet}, true);
901902
${name}.run(1);
902903
});
@@ -942,6 +943,7 @@ export default class ElementWrapper extends Wrapper {
942943
if (outro) {
943944
intro_block = b`
944945
@add_render_callback(() => {
946+
if (!#current) return;
945947
if (${outro_name}) ${outro_name}.end(1);
946948
${intro_name} = @create_in_transition(${this.var}, ${fn}, ${snippet});
947949
${intro_name}.start();

0 commit comments

Comments
 (0)