mirror of https://github.com/sveltejs/svelte
fix: transform derived assignments and select function bindings correctly during server-side rendering (#18669)
follow-up to the fix in #18607 - there are a two more bugs related to writeable deriveds in that areapull/18721/head
parent
14ec75c5fe
commit
68e7c9b521
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: transform derived assignments and select function bindings correctly during server-side rendering
|
||||
@ -1,6 +0,0 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
ssrHtml: '<p>LATER</p> <input value="LATER">',
|
||||
html: '<p>LATER</p> <input>'
|
||||
});
|
||||
@ -0,0 +1,6 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
ssrHtml: '<p>y:y</p> <p>LATER</p> <input value="LATER">',
|
||||
html: '<p>y:y</p> <p>LATER</p> <input>'
|
||||
});
|
||||
@ -0,0 +1,9 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
ssrHtml: '<select><option value="a">a</option><option value="b" selected="">b</option></select>',
|
||||
test({ assert, target }) {
|
||||
const select = /** @type {HTMLSelectElement} */ (target.querySelector('select'));
|
||||
assert.equal(select.value, 'b');
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,9 @@
|
||||
<script>
|
||||
let source = $state('b');
|
||||
let value = $derived(source);
|
||||
</script>
|
||||
|
||||
<select bind:value={() => value, (next) => (value = next)}>
|
||||
<option value="a">a</option>
|
||||
<option value="b">b</option>
|
||||
</select>
|
||||
Loading…
Reference in new issue