Merge branch 'fix-lost-anchor-if-if-block-first' of https://github.com/stalkerg/svelte into stalkerg-fix-lost-anchor-if-if-block-first

pull/1792/head
Rich Harris 6 years ago
commit e5f5995458

@ -99,9 +99,7 @@ export default class FragmentWrapper {
this.nodes.unshift(wrapper); this.nodes.unshift(wrapper);
link(lastChild, lastChild = wrapper); link(lastChild, lastChild = wrapper);
} } else {
else {
const Wrapper = wrappers[child.type]; const Wrapper = wrappers[child.type];
if (!Wrapper) continue; if (!Wrapper) continue;
@ -120,10 +118,6 @@ export default class FragmentWrapper {
if (!first.data) { if (!first.data) {
first.var = null; first.var = null;
this.nodes.shift(); this.nodes.shift();
if (this.nodes.length) {
link(null, this.nodes[0]);
}
} }
} }
} }

@ -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>' );
}
};

@ -0,0 +1,6 @@
<div>
{#if visible}
<div>i am visible</div>
{/if}
<div>before me</div>
</div>
Loading…
Cancel
Save