explain elseif locality

pull/10798/head
Rich Harris 2 years ago
parent 2bcee65e2b
commit a199e5a104

@ -2583,7 +2583,27 @@ export const template_visitors = {
];
if (node.elseif) {
// the additional effect layer shouldn't affect local transitions
// We treat this...
//
// {#if x}
// ...
// {:else}
// {#if y}
// <div transition:foo>...</div>
// {/if}
// {/if}
//
// ...slightly differently to this...
//
// {#if x}
// ...
// {:else if y}
// <div transition:foo>...</div>
// {/if}
//
// ...even though they're logically equivalent. In the first case, the
// transition will only play when `y` changes, but in the second it
// should play when `x` or `y` change — both are considered 'local'
args.push(b.literal(true));
}

Loading…
Cancel
Save