Skip to content

Commit

Permalink
fix: Local transitions from #key blocks
Browse files Browse the repository at this point in the history
When adding `|local` to a transition inside a {#key} block, only the outro was triggered not the intro.

This PR fixes sveltejs#5950
  • Loading branch information
bfanger authored and tanhauhau committed Apr 8, 2022
1 parent 54197c5 commit a8d4bfd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/compiler/compile/render_dom/wrappers/KeyBlock.ts
@@ -1,7 +1,6 @@
import Wrapper from './shared/Wrapper';
import Renderer from '../Renderer';
import Block from '../Block';
import EachBlock from '../../nodes/EachBlock';
import KeyBlock from '../../nodes/KeyBlock';
import create_debugging_comment from './shared/create_debugging_comment';
import FragmentWrapper from './Fragment';
Expand All @@ -19,7 +18,7 @@ export default class KeyBlockWrapper extends Wrapper {
renderer: Renderer,
block: Block,
parent: Wrapper,
node: EachBlock,
node: KeyBlock,
strip_whitespace: boolean,
next_sibling: Wrapper
) {
Expand Down Expand Up @@ -107,7 +106,7 @@ export default class KeyBlockWrapper extends Wrapper {
}
${this.var} = ${this.block.name}(#ctx);
${this.var}.c();
${has_transitions && b`@transition_in(${this.var})`}
${has_transitions && b`@transition_in(${this.var}, 1)`}
${this.var}.m(${this.get_update_mount_node(anchor)}, ${anchor});
`;

Expand Down

0 comments on commit a8d4bfd

Please sign in to comment.