Skip to content

Commit

Permalink
Fix removing next link during strip whitespaces for first element.
Browse files Browse the repository at this point in the history
  • Loading branch information
stalkerg committed Oct 19, 2018
1 parent c0ba6fb commit 0d797ea
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/compile/render-dom/wrappers/Fragment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@ export default class FragmentWrapper {
if (!first.data) {
first.var = null;
this.nodes.shift();

if (this.nodes.length) {
link(null, this.nodes[0]);
}
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions test/runtime/samples/if-block-first/_config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export default {
data: {
visible: false
},

html: '<div><div>before me</div></div>',

test ( assert, component, target ) {
component.set({ visible: true });
assert.htmlEqual(target.innerHTML, '<div><div>i am visible</div><div>before me</div></div>' );
}
};
6 changes: 6 additions & 0 deletions test/runtime/samples/if-block-first/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div>
{#if visible}
<div>i am visible</div>
{/if}
<div>before me</div>
</div>

0 comments on commit 0d797ea

Please sign in to comment.