mirror of https://github.com/sveltejs/svelte
fix: ensure "is standalone child" is correctly reset (#17944)
We didn't set this back to `false`, which can lead to wrong results if the parent happened to have it set to `true` Fixes #17730pull/17935/merge
parent
98e8b635fa
commit
d4bd6ad8f3
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: ensure "is standalone child" is correctly reset
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
<script>
|
||||||
|
let { src } = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<img {src} />
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
<script>
|
||||||
|
let { children } = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<a href="/">
|
||||||
|
{@render children()}
|
||||||
|
</a>
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
import { tick } from 'svelte';
|
||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
mode: ['hydrate'],
|
||||||
|
|
||||||
|
async test({ assert, target }) {
|
||||||
|
await tick();
|
||||||
|
assert.htmlEqual(
|
||||||
|
target.innerHTML,
|
||||||
|
`<a href="/"><div>card</div> <img src="https://svelte.dev" /></a>`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import Image from "./Image.svelte";
|
||||||
|
import Link from "./Link.svelte";
|
||||||
|
|
||||||
|
let url = $derived(await 'https://svelte.dev');
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<Link>
|
||||||
|
<div>card</div>
|
||||||
|
<Image src={url} />
|
||||||
|
</Link>
|
||||||
Loading…
Reference in new issue