mirror of https://github.com/sveltejs/svelte
fix: improve internal render effect sequencing (#10769)
We need to additionally check the levels to not accidentally insert a higher level before a lower level fixes #10741pull/10777/head
parent
8a4dfb483b
commit
468ecda6ea
@ -0,0 +1,5 @@
|
||||
---
|
||||
"svelte": patch
|
||||
---
|
||||
|
||||
fix: improve internal render effect sequencing
|
@ -0,0 +1,9 @@
|
||||
<script>
|
||||
let { post } = $props();
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>{post.title}</title>
|
||||
</svelte:head>
|
||||
|
||||
<p>{post.title}</p>
|
@ -0,0 +1,22 @@
|
||||
import { flushSync } from 'svelte';
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
async test({ assert, target, window }) {
|
||||
const [btn1] = target.querySelectorAll('button');
|
||||
|
||||
assert.htmlEqual(window.document.head.innerHTML, ``);
|
||||
|
||||
flushSync(() => {
|
||||
btn1.click();
|
||||
});
|
||||
|
||||
assert.htmlEqual(window.document.head.innerHTML, `<title>hello world</title>`);
|
||||
|
||||
flushSync(() => {
|
||||
btn1.click();
|
||||
});
|
||||
|
||||
assert.htmlEqual(window.document.head.innerHTML, `<title>hello world</title>`);
|
||||
}
|
||||
});
|
@ -0,0 +1,17 @@
|
||||
<script>
|
||||
import Seo from './Seo.svelte';
|
||||
|
||||
let post = $state(null);
|
||||
|
||||
function toggle() {
|
||||
post = post ? null : { title: 'hello world' };
|
||||
}
|
||||
</script>
|
||||
|
||||
<button onclick={toggle}>
|
||||
toggle
|
||||
</button>
|
||||
|
||||
{#if post}
|
||||
<Seo {post} />
|
||||
{/if}
|
Loading…
Reference in new issue