Skip to content

Commit

Permalink
fix #1780 just start use parent instead parent.parent in IfBlock wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
stalkerg authored and Conduitry committed Oct 23, 2018
1 parent 1deb25e commit 079bd4e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/compile/render-dom/wrappers/IfBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class IfBlockBranch extends Wrapper {
)
});

this.fragment = new FragmentWrapper(renderer, this.block, node.children, parent.parent, stripWhitespace, nextSibling);
this.fragment = new FragmentWrapper(renderer, this.block, node.children, parent, stripWhitespace, nextSibling);

this.isDynamic = this.block.dependencies.size > 0;
}
Expand Down
13 changes: 13 additions & 0 deletions test/runtime/samples/each-block-in-if-block/_config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export default {
data: {
dummy: false,
fruits: ['Apple', 'Banana', 'Tomato'],
},

html: '<div><div>Apple</div><div>Banana</div><div>Tomato</div></div>',

test ( assert, component, target ) {
component.set({ dummy: true });
assert.htmlEqual(target.innerHTML, '<div><div>Apple</div><div>Banana</div><div>Tomato</div></div>' );
}
};
7 changes: 7 additions & 0 deletions test/runtime/samples/each-block-in-if-block/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div>
{#if fruits}
{#each fruits as fruit (fruit)}
<div>{fruit}</div>
{/each}
{/if}
</div>

0 comments on commit 079bd4e

Please sign in to comment.