mirror of https://github.com/sveltejs/svelte
fix: ensure nested blocks are inert during outro transitions (#10126)
* fix: ensure nested blocks are inert during outro transitions * lintpull/10128/head
parent
3624a4c2a0
commit
f5dc562ee7
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: ensure nested blocks are inert during outro transitions
|
@ -0,0 +1,16 @@
|
||||
import { flushSync } from 'svelte';
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
html: `<button>hide</button><div>hello</div>`,
|
||||
|
||||
async test({ assert, target }) {
|
||||
const [btn1, btn2] = target.querySelectorAll('button');
|
||||
|
||||
flushSync(() => {
|
||||
btn1.click();
|
||||
});
|
||||
|
||||
assert.htmlEqual(target.innerHTML, `<button>hide</button><div style="opacity: 0;">hello</div>`);
|
||||
}
|
||||
});
|
@ -0,0 +1,17 @@
|
||||
<script>
|
||||
import { fade } from "svelte/transition";
|
||||
|
||||
let state = $state("hello");
|
||||
</script>
|
||||
|
||||
<button onclick={() => state = ''}>hide</button>
|
||||
|
||||
{#if state}
|
||||
<div in:fade={{ duration: 2000 }} out:fade={{ duration: 2000 }}>
|
||||
{#if true}
|
||||
{state}
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
Loading…
Reference in new issue