From 4779d43c2670b56bd03643389b795f38bfc71ef5 Mon Sep 17 00:00:00 2001 From: pushkine Date: Wed, 22 Apr 2020 16:59:42 +0200 Subject: [PATCH] fix node anchor --- src/compiler/compile/render_dom/wrappers/Slot.ts | 2 +- .../samples/slot-if-block-update-no-anchor/_config.js | 7 +++++++ .../samples/slot-if-block-update-no-anchor/main.svelte | 9 +++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 test/runtime/samples/slot-if-block-update-no-anchor/_config.js create mode 100644 test/runtime/samples/slot-if-block-update-no-anchor/main.svelte diff --git a/src/compiler/compile/render_dom/wrappers/Slot.ts b/src/compiler/compile/render_dom/wrappers/Slot.ts index 1111a7cffe..492136303a 100644 --- a/src/compiler/compile/render_dom/wrappers/Slot.ts +++ b/src/compiler/compile/render_dom/wrappers/Slot.ts @@ -45,7 +45,7 @@ export default class SlotWrapper extends Wrapper { renderer, this.fallback, node.children, - parent, + this, strip_whitespace, next_sibling ); diff --git a/test/runtime/samples/slot-if-block-update-no-anchor/_config.js b/test/runtime/samples/slot-if-block-update-no-anchor/_config.js new file mode 100644 index 0000000000..060cbaa619 --- /dev/null +++ b/test/runtime/samples/slot-if-block-update-no-anchor/_config.js @@ -0,0 +1,7 @@ +export default { + test({ assert, target, component }) { + assert.htmlEqual(target.innerHTML, ``); + component.enabled = true; + assert.htmlEqual(target.innerHTML, `enabled`); + }, +}; diff --git a/test/runtime/samples/slot-if-block-update-no-anchor/main.svelte b/test/runtime/samples/slot-if-block-update-no-anchor/main.svelte new file mode 100644 index 0000000000..b87dd04df6 --- /dev/null +++ b/test/runtime/samples/slot-if-block-update-no-anchor/main.svelte @@ -0,0 +1,9 @@ + + + + + {#if enabled}enabled{/if} + +