mirror of https://github.com/sveltejs/svelte
fix: visit synthetic value node during ssr (#17824)
Closes #17821 ### Before submitting the PR, please make sure you do the following - [x] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs - [x] Prefix your PR title with `feat:`, `fix:`, `chore:`, or `docs:`. - [x] This message body should clearly illustrate what problems it solves. - [x] Ideally, include a test that fails without this PR but passes with it. - [x] If this PR changes code within `packages/svelte/src`, add a changeset (`npx changeset`). ### Tests and linting - [x] Run the tests with `pnpm test` and lint the project with `pnpm lint`pull/17812/head
parent
a10cf95ca7
commit
e3d277b000
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: visit synthetic value node during ssr
|
||||||
@ -0,0 +1 @@
|
|||||||
|
<!--[--><select><option>Dog</option><option>cat</option></select><!--]-->
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
<script>
|
||||||
|
import { writable } from 'svelte/store';
|
||||||
|
|
||||||
|
const value = writable('dog');
|
||||||
|
const label = writable('Dog');
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<select bind:value={$value}>
|
||||||
|
<option>{$label}</option>
|
||||||
|
<option>cat</option>
|
||||||
|
</select>
|
||||||
@ -0,0 +1 @@
|
|||||||
|
<!--[--><select><option disabled="" value="" selected="">placeholder</option><option value="a">A</option><option value="b">B</option></select><!--]-->
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
<script>
|
||||||
|
import { readable } from 'svelte/store';
|
||||||
|
|
||||||
|
const t = readable((/** @type {string} */ key) => key);
|
||||||
|
|
||||||
|
let value = $state('');
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<select bind:value>
|
||||||
|
<option disabled value="">{$t('placeholder')}</option>
|
||||||
|
<option value="a">A</option>
|
||||||
|
<option value="b">B</option>
|
||||||
|
</select>
|
||||||
Loading…
Reference in new issue