From 4779d43c2670b56bd03643389b795f38bfc71ef5 Mon Sep 17 00:00:00 2001 From: pushkine Date: Wed, 22 Apr 2020 16:59:42 +0200 Subject: [PATCH 1/2] 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 1111a7cffe0c..492136303a85 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 000000000000..060cbaa6192a --- /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 000000000000..b87dd04df62d --- /dev/null +++ b/test/runtime/samples/slot-if-block-update-no-anchor/main.svelte @@ -0,0 +1,9 @@ + + + + + {#if enabled}enabled{/if} + + From ad1a4d64bc31e851012d8c55510923294abf817c Mon Sep 17 00:00:00 2001 From: Conduitry Date: Thu, 23 Apr 2020 09:02:53 -0400 Subject: [PATCH 2/2] indentation --- .../samples/slot-if-block-update-no-anchor/main.svelte | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 index b87dd04df62d..7960f35bc9cd 100644 --- a/test/runtime/samples/slot-if-block-update-no-anchor/main.svelte +++ b/test/runtime/samples/slot-if-block-update-no-anchor/main.svelte @@ -1,9 +1,9 @@ - - {#if enabled}enabled{/if} - + + {#if enabled}enabled{/if} +