mirror of https://github.com/sveltejs/svelte
Merge pull request #3145 from sveltejs/gh-2034
update bind:this references when setting to nullpull/3149/head
commit
2915cf9cc3
@ -0,0 +1,21 @@
|
||||
export default {
|
||||
skip_if_ssr: true,
|
||||
|
||||
html: `
|
||||
<div>The text is hello</div>
|
||||
<h1>hello</h1>
|
||||
`,
|
||||
|
||||
test({ assert, component, target }) {
|
||||
component.visible = false;
|
||||
assert.htmlEqual(target.innerHTML, `
|
||||
<div>The text is missing</div>
|
||||
`);
|
||||
|
||||
component.visible = true;
|
||||
assert.htmlEqual(target.innerHTML, `
|
||||
<div>The text is hello</div>
|
||||
<h1>hello</h1>
|
||||
`);
|
||||
}
|
||||
};
|
@ -0,0 +1,9 @@
|
||||
<script>
|
||||
export let visible = true;
|
||||
let h1;
|
||||
</script>
|
||||
|
||||
<div>The text is {h1 ? h1.textContent : 'missing'}</div>
|
||||
{#if visible}
|
||||
<h1 bind:this={h1}>hello</h1>
|
||||
{/if}
|
Loading…
Reference in new issue