mirror of https://github.com/sveltejs/svelte
fix: better handling of empty text node hydration (#10545)
* fix: better handling of empty text node hydrationpull/10553/head
parent
41e7dab755
commit
7032837ef0
@ -0,0 +1,5 @@
|
||||
---
|
||||
"svelte": patch
|
||||
---
|
||||
|
||||
fix: better handling of empty text node hydration
|
@ -0,0 +1,15 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
html: `<button type="button">Update Text</button><div></div>`,
|
||||
|
||||
async test({ assert, target }) {
|
||||
const btn = target.querySelector('button');
|
||||
|
||||
await btn?.click();
|
||||
assert.htmlEqual(
|
||||
target.innerHTML,
|
||||
`<button type="button">Update Text</button><div>updated</div>`
|
||||
);
|
||||
}
|
||||
});
|
@ -0,0 +1,11 @@
|
||||
<script>
|
||||
let text = $state('');
|
||||
|
||||
function update_text() {
|
||||
text = 'updated';
|
||||
}
|
||||
</script>
|
||||
|
||||
<button type="button" on:click={update_text}>Update Text</button>
|
||||
|
||||
<div>{text}</div>
|
Loading…
Reference in new issue