use unique name for rects

pull/1457/head
Rich Harris 7 years ago
parent c9651348ee
commit 5848cc3204

@ -314,13 +314,15 @@ export default class EachBlock extends Node {
const dynamic = this.block.hasUpdateMethod; const dynamic = this.block.hasUpdateMethod;
const rects = block.getUniqueName('rects');
block.builders.update.addBlock(deindent` block.builders.update.addBlock(deindent`
const ${this.each_block_value} = ${snippet}; const ${this.each_block_value} = ${snippet};
${this.block.hasOutroMethod && `@transitionManager.groupOutros();`} ${this.block.hasOutroMethod && `@transitionManager.groupOutros();`}
${this.block.animation && `const rects = @measure(${blocks});`} ${this.block.animation && `const ${rects} = @measure(${blocks});`}
${blocks} = @updateKeyedEach(${blocks}, #component, changed, ${get_key}, ${dynamic ? '1' : '0'}, ctx, ${this.each_block_value}, ${lookup}, ${updateMountNode}, ${String(this.block.hasOutroMethod)}, ${create_each_block}, "${mountOrIntro}", ${anchor}, ${this.get_each_context}); ${blocks} = @updateKeyedEach(${blocks}, #component, changed, ${get_key}, ${dynamic ? '1' : '0'}, ctx, ${this.each_block_value}, ${lookup}, ${updateMountNode}, ${String(this.block.hasOutroMethod)}, ${create_each_block}, "${mountOrIntro}", ${anchor}, ${this.get_each_context});
${this.block.animation && `@animate(${blocks}, rects, %animations-${this.children[0].animation.name}, {});`} ${this.block.animation && `@animate(${blocks}, ${rects}, %animations-${this.children[0].animation.name}, {});`}
`); `);
if (this.compiler.options.nestedTransitions) { if (this.compiler.options.nestedTransitions) {

Loading…
Cancel
Save