Merge branch 'master' into gh-4298

pull/4300/head
Conduitry 6 years ago
commit e6dc80d947

@ -2,6 +2,7 @@
## Unreleased ## Unreleased
* Fix updating a `<slot>` inside an `{#if}` or other block ([#4292](https://github.com/sveltejs/svelte/issues/4292))
* Fix using RxJS observables in `derived` stores ([#4298](https://github.com/sveltejs/svelte/issues/4298)) * Fix using RxJS observables in `derived` stores ([#4298](https://github.com/sveltejs/svelte/issues/4298))
## 3.17.2 ## 3.17.2

@ -160,6 +160,9 @@ export default class Block {
}); });
this.has_update_method = true; this.has_update_method = true;
if (this.parent) {
this.parent.add_dependencies(dependencies);
}
} }
add_element( add_element(

@ -0,0 +1,6 @@
<script>
let val;
</script>
<input bind:value={val} />
<slot {val}></slot>

@ -0,0 +1,30 @@
export default {
html: `
<input>
`,
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,
`
<input>
Display: a
`
);
input.value = 'abc';
await input.dispatchEvent(new window.Event('input'));
assert.htmlEqual(
target.innerHTML,
`
<input>
Display: abc
`
);
},
};

@ -0,0 +1,10 @@
<script>
import Input from "./Input.svelte";
import Display from "./Display.svelte";
</script>
<Input let:val={foo}>
{#if foo}
<Display>{foo}</Display>
{/if}
</Input>
Loading…
Cancel
Save