diff --git a/src/compiler/compile/render_dom/wrappers/KeyBlock.ts b/src/compiler/compile/render_dom/wrappers/KeyBlock.ts
index 9688337d7c..cbd021ff6c 100644
--- a/src/compiler/compile/render_dom/wrappers/KeyBlock.ts
+++ b/src/compiler/compile/render_dom/wrappers/KeyBlock.ts
@@ -44,7 +44,7 @@ export default class KeyBlockWrapper extends Wrapper {
renderer,
this.block,
node.children,
- parent,
+ this,
strip_whitespace,
next_sibling
);
diff --git a/test/runtime/samples/key-block-static-if/_config.js b/test/runtime/samples/key-block-static-if/_config.js
new file mode 100644
index 0000000000..2926ad7c24
--- /dev/null
+++ b/test/runtime/samples/key-block-static-if/_config.js
@@ -0,0 +1,21 @@
+export default {
+ html: `
+
+
+ `,
+ async test({ assert, component, target, window }) {
+ const button = target.querySelector('button');
+
+ await button.dispatchEvent(new window.Event('click'));
+
+ assert.htmlEqual(target.innerHTML, `
+
+
+ `);
+ }
+};
diff --git a/test/runtime/samples/key-block-static-if/main.svelte b/test/runtime/samples/key-block-static-if/main.svelte
new file mode 100644
index 0000000000..cbacb77674
--- /dev/null
+++ b/test/runtime/samples/key-block-static-if/main.svelte
@@ -0,0 +1,17 @@
+
+
+
+ {#key slide}
+ {#if num}
+ First
+ {/if}
+ {/key}
+ Second
+
+
+
\ No newline at end of file