mirror of https://github.com/sveltejs/svelte
fix: ensure input value is correctly set during hydration (#12083)
* fix: ensure input value is correctly set during hydration * fix: ensure input value is correctly set during hydration * address feedback * fix typos * early return, var * fix test * Update packages/svelte/src/internal/client/dom/elements/attributes.js Co-authored-by: Rich Harris <rich.harris@vercel.com> * update changeset * tweak names --------- Co-authored-by: Rich Harris <rich.harris@vercel.com>pull/12086/head
parent
696a4b3dae
commit
399e464b44
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"svelte": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: preserve current input values when removing defaults
|
@ -0,0 +1,16 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
server_props: {
|
||||||
|
name: 'server'
|
||||||
|
},
|
||||||
|
|
||||||
|
props: {
|
||||||
|
name: 'browser'
|
||||||
|
},
|
||||||
|
|
||||||
|
test(assert, target) {
|
||||||
|
const input = target.querySelector('input');
|
||||||
|
assert.equal(input?.value, 'browser');
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1 @@
|
|||||||
|
<!--[--><input type="text"><!--]-->
|
@ -0,0 +1,5 @@
|
|||||||
|
<script>
|
||||||
|
const { name } = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<input type="text" value={name} />
|
Loading…
Reference in new issue