keyed each block and select fixes

pull/7738/head
Rich Harris 8 years ago
parent 93087403d3
commit f9e17d6d0e

@ -228,7 +228,8 @@ export default class Block {
}
if (this.first) {
properties.addBlock(`first: ${this.first},`);
properties.addBlock(`first: null,`);
this.builders.hydrate.addLine( `this.first = ${this.first};` );
}
if (this.builders.create.isEmpty()) {

@ -132,7 +132,7 @@ function keyed(
block: Block,
state: State,
node: Node,
snippet,
snippet: string,
{
each_block,
create_each_block,
@ -282,7 +282,6 @@ function keyed(
} else {
if ( ${iteration} ) {
// probably a deletion
while ( ${expected} && ${expected}.key !== ${key} ) {
${expected}.discard = true;
discard_pile.push( ${expected} );

@ -199,7 +199,7 @@ export default function visitElement(
}
if (node.initialUpdate) {
block.builders.hydrate.addBlock(node.initialUpdate);
block.builders.mount.addBlock(node.initialUpdate);
}
block.builders.claim.addLine(

@ -368,6 +368,7 @@ function compoundWithOutros(
const createNewBlock = deindent`
${name} = ${if_blocks}[ ${current_block_index} ] = ${if_block_creators}[ ${current_block_index} ]( ${params}, ${block.component} );
${name}.create();
${name}.${mountOrIntro}( ${parentNode}, ${anchor} );
`;

Loading…
Cancel
Save