diff --git a/src/compiler/compile/render_dom/Block.ts b/src/compiler/compile/render_dom/Block.ts
index 68d28024fe..62bdc5bdd9 100644
--- a/src/compiler/compile/render_dom/Block.ts
+++ b/src/compiler/compile/render_dom/Block.ts
@@ -160,6 +160,9 @@ export default class Block {
});
this.has_update_method = true;
+ if (this.parent) {
+ this.parent.add_dependencies(dependencies);
+ }
}
add_element(
diff --git a/test/runtime/samples/component-slot-nested-if/Display.svelte b/test/runtime/samples/component-slot-nested-if/Display.svelte
new file mode 100644
index 0000000000..d9034e4be2
--- /dev/null
+++ b/test/runtime/samples/component-slot-nested-if/Display.svelte
@@ -0,0 +1,2 @@
+Display:
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-nested-if/Input.svelte b/test/runtime/samples/component-slot-nested-if/Input.svelte
new file mode 100644
index 0000000000..fd8f22db00
--- /dev/null
+++ b/test/runtime/samples/component-slot-nested-if/Input.svelte
@@ -0,0 +1,6 @@
+
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-nested-if/_config.js b/test/runtime/samples/component-slot-nested-if/_config.js
new file mode 100644
index 0000000000..89dfd006cc
--- /dev/null
+++ b/test/runtime/samples/component-slot-nested-if/_config.js
@@ -0,0 +1,30 @@
+export default {
+ html: `
+
+ `,
+ async test({ assert, target, snapshot, component, window }) {
+ const input = target.querySelector('input');
+
+ input.value = 'a';
+ await input.dispatchEvent(new window.Event('input'));
+
+ assert.htmlEqual(
+ target.innerHTML,
+ `
+
+ Display: a
+ `
+ );
+
+ input.value = 'abc';
+ await input.dispatchEvent(new window.Event('input'));
+
+ assert.htmlEqual(
+ target.innerHTML,
+ `
+
+ Display: abc
+ `
+ );
+ },
+};
diff --git a/test/runtime/samples/component-slot-nested-if/main.svelte b/test/runtime/samples/component-slot-nested-if/main.svelte
new file mode 100644
index 0000000000..52ce86f13f
--- /dev/null
+++ b/test/runtime/samples/component-slot-nested-if/main.svelte
@@ -0,0 +1,10 @@
+
+
+
+ {#if foo}
+ {foo}
+ {/if}
+