mirror of https://github.com/sveltejs/svelte
fix: ensure bindings always take precedence over spreads (#14575)
parent
6a6b4ec36a
commit
ca67aa1b34
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: ensure bindings always take precedence over spreads
|
@ -0,0 +1,9 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
ssrHtml: `<input value="foo">`,
|
||||||
|
|
||||||
|
test({ assert, target }) {
|
||||||
|
assert.equal(target.querySelector('input')?.value, 'foo');
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,5 @@
|
|||||||
|
<script>
|
||||||
|
let { value = $bindable(), ...properties } = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<input bind:value {...properties} />
|
@ -0,0 +1,11 @@
|
|||||||
|
<script>
|
||||||
|
import Button from './input.svelte';
|
||||||
|
|
||||||
|
let value = $state('foo');
|
||||||
|
|
||||||
|
const props = $state({
|
||||||
|
value: 'bar'
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<Button bind:value {...props} />
|
Loading…
Reference in new issue