Skip to content

Commit

Permalink
fix: When intro was triggered before the outro, that outro was canceled
Browse files Browse the repository at this point in the history
  • Loading branch information
bfanger authored and Bob Fanger committed Feb 22, 2023
1 parent 57d869d commit 2bd3f26
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/compiler/compile/render_dom/wrappers/Element/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,7 @@ export default class ElementWrapper extends Wrapper {

const intro_block = b`
@add_render_callback(() => {
if (!#current) return;
if (!${name}) ${name} = @create_bidirectional_transition(${this.var}, ${fn}, ${snippet}, true);
${name}.run(1);
});
Expand Down Expand Up @@ -942,6 +943,7 @@ export default class ElementWrapper extends Wrapper {
if (outro) {
intro_block = b`
@add_render_callback(() => {
if (!#current) return;
if (${outro_name}) ${outro_name}.end(1);
${intro_name} = @create_in_transition(${this.var}, ${fn}, ${snippet});
${intro_name}.start();
Expand Down

0 comments on commit 2bd3f26

Please sign in to comment.