diff --git a/src/generators/dom/visitors/IfBlock.ts b/src/generators/dom/visitors/IfBlock.ts index 117f979252..e7fecebefe 100644 --- a/src/generators/dom/visitors/IfBlock.ts +++ b/src/generators/dom/visitors/IfBlock.ts @@ -395,7 +395,7 @@ function compoundWithOutros( if (dynamic) { block.builders.update.addBlock(deindent` var ${previous_block_index} = ${current_block_index}; - ${current_block_index} = ${get_block}( state ); + ${current_block_index} = ${get_block}( ${params} ); if ( ${current_block_index} === ${previous_block_index} ) { ${if_current_block_index}${if_blocks}[ ${current_block_index} ].update( changed, ${params} ); } else { @@ -405,7 +405,7 @@ function compoundWithOutros( } else { block.builders.update.addBlock(deindent` var ${previous_block_index} = ${current_block_index}; - ${current_block_index} = ${get_block}( state ); + ${current_block_index} = ${get_block}( ${params} ); if ( ${current_block_index} !== ${previous_block_index} ) { ${changeBlock} } diff --git a/test/runtime/samples/transition-js-if-block-in-each-block-bidi-2/_config.js b/test/runtime/samples/transition-js-if-block-in-each-block-bidi-2/_config.js new file mode 100644 index 0000000000..60115a0351 --- /dev/null +++ b/test/runtime/samples/transition-js-if-block-in-each-block-bidi-2/_config.js @@ -0,0 +1,32 @@ +export default { + data: { + foo: false, + threshold: 5 + }, + + html: ` +
1
+
2
+
3
+
4
+
5
+ `, + + test ( assert, component, target, window, raf ) { + const divs = target.querySelectorAll('div'); + + raf.tick(100); + + component.set({ threshold: 4 }); + + raf.tick( 200 ); + assert.htmlEqual(target.innerHTML, ` +
1
+
2
+
3
+
4
+ `); + + component.destroy(); + } +}; \ No newline at end of file diff --git a/test/runtime/samples/transition-js-if-block-in-each-block-bidi-2/main.html b/test/runtime/samples/transition-js-if-block-in-each-block-bidi-2/main.html new file mode 100644 index 0000000000..d68c95e8b0 --- /dev/null +++ b/test/runtime/samples/transition-js-if-block-in-each-block-bidi-2/main.html @@ -0,0 +1,26 @@ +{{#each [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] as number}} + {{#if foo}} + {{#if threshold >= number}} +
{{number}}
+ {{/if}} + {{else}} + {{#if threshold >= number}} +
{{number}}
+ {{/if}} + {{/if}} +{{/each}} + + \ No newline at end of file