mirror of https://github.com/sveltejs/svelte
fix: serialize input default values during SSR (#18733)
Alternative to #18452 --------- Co-authored-by: svelte-triage-bot <team@svelte.com>pull/18754/head
parent
b2c22ab66d
commit
b580455c9c
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: serialize input default values during server rendering
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({});
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
<input value="hello" />
|
||||||
|
<input type="checkbox" checked />
|
||||||
|
<input value="spread" checked />
|
||||||
|
<input value="" />
|
||||||
|
<input value="" />
|
||||||
|
<input value="" />
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
<script>
|
||||||
|
const props = { defaultValue: 'spread', defaultChecked: true };
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<input defaultValue="hello" />
|
||||||
|
<input type="checkbox" defaultChecked />
|
||||||
|
<input {...props} />
|
||||||
|
<input {...props} value="" checked={false} />
|
||||||
|
<input value="" checked={false} {...props} />
|
||||||
|
<input {...props} {...{ VALUE: '', CHECKED: false }} />
|
||||||
Loading…
Reference in new issue