diff --git a/src/generators/dom/visitors/EachBlock.ts b/src/generators/dom/visitors/EachBlock.ts index 212f1af8b3..39657aff4d 100644 --- a/src/generators/dom/visitors/EachBlock.ts +++ b/src/generators/dom/visitors/EachBlock.ts @@ -139,7 +139,7 @@ function keyed ( generator: DomGenerator, block: Block, state: State, node: Node block.builders.mount.addBlock( deindent` var ${iteration} = ${head}; while ( ${iteration} ) { - ${iteration}.${mountOrIntro}( ${block.target}, null ); + ${iteration}.${mountOrIntro}( ${block.target}, anchor ); ${iteration} = ${iteration}.next; } ` ); @@ -284,7 +284,7 @@ function unkeyed ( generator: DomGenerator, block: Block, state: State, node: No if ( !state.parentNode ) { block.builders.mount.addBlock( deindent` for ( var ${i} = 0; ${i} < ${iterations}.length; ${i} += 1 ) { - ${iterations}[${i}].${mountOrIntro}( ${block.target}, null ); + ${iterations}[${i}].${mountOrIntro}( ${block.target}, anchor ); } ` ); } diff --git a/test/js/samples/each-block-changed-check/_actual-bundle.js b/test/js/samples/each-block-changed-check/_actual-bundle.js index 2c7ba6db88..8af4cd0f80 100644 --- a/test/js/samples/each-block-changed-check/_actual-bundle.js +++ b/test/js/samples/each-block-changed-check/_actual-bundle.js @@ -154,7 +154,7 @@ function create_main_fragment ( state, component ) { return { mount: function ( target, anchor ) { for ( var i = 0; i < each_block_iterations.length; i += 1 ) { - each_block_iterations[i].mount( target, null ); + each_block_iterations[i].mount( target, anchor ); } insertNode( text, target, anchor ); diff --git a/test/js/samples/each-block-changed-check/expected-bundle.js b/test/js/samples/each-block-changed-check/expected-bundle.js index 2c7ba6db88..8af4cd0f80 100644 --- a/test/js/samples/each-block-changed-check/expected-bundle.js +++ b/test/js/samples/each-block-changed-check/expected-bundle.js @@ -154,7 +154,7 @@ function create_main_fragment ( state, component ) { return { mount: function ( target, anchor ) { for ( var i = 0; i < each_block_iterations.length; i += 1 ) { - each_block_iterations[i].mount( target, null ); + each_block_iterations[i].mount( target, anchor ); } insertNode( text, target, anchor ); diff --git a/test/js/samples/each-block-changed-check/expected.js b/test/js/samples/each-block-changed-check/expected.js index 128d332196..96624d88db 100644 --- a/test/js/samples/each-block-changed-check/expected.js +++ b/test/js/samples/each-block-changed-check/expected.js @@ -19,7 +19,7 @@ function create_main_fragment ( state, component ) { return { mount: function ( target, anchor ) { for ( var i = 0; i < each_block_iterations.length; i += 1 ) { - each_block_iterations[i].mount( target, null ); + each_block_iterations[i].mount( target, anchor ); } insertNode( text, target, anchor ); @@ -160,4 +160,4 @@ SvelteComponent.prototype.teardown = SvelteComponent.prototype.destroy = functio this._torndown = true; }; -export default SvelteComponent; \ No newline at end of file +export default SvelteComponent;