mirror of https://github.com/sveltejs/svelte
Fix #4803 by changing setAttributes to set value as well as __value
parent
c743e72a1e
commit
43ac9aef06
@ -0,0 +1,15 @@
|
|||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
props: {
|
||||||
|
'data-foo': 'bar'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
html: `<input data-foo="bar" type="radio" value="abc">`,
|
||||||
|
|
||||||
|
async test({ assert, component, target, window }) {
|
||||||
|
const input = target.querySelector('input');
|
||||||
|
assert.equal(input.value, 'abc');
|
||||||
|
assert.equal(input.__value, 'abc');
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,6 @@
|
|||||||
|
<script>
|
||||||
|
export let props;
|
||||||
|
let radioValue;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<input type="radio" value="abc" {...props} bind:group={radioValue} />
|
@ -0,0 +1,22 @@
|
|||||||
|
export default {
|
||||||
|
// This fails because the test checks for __value being set on the node, which
|
||||||
|
// bind:group requires to work, but when a spread is used to set `value` on the
|
||||||
|
// element, the code that also sets `__value` on the node is not triggered.
|
||||||
|
// This is issue #4808.
|
||||||
|
skip: true,
|
||||||
|
|
||||||
|
props: {
|
||||||
|
props: {
|
||||||
|
'data-foo': 'bar',
|
||||||
|
value: 'abc'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
html: `<input data-foo="bar" type="radio" value="abc">`,
|
||||||
|
|
||||||
|
async test({ assert, component, target, window }) {
|
||||||
|
const input = target.querySelector('input');
|
||||||
|
assert.equal(input.value, 'abc');
|
||||||
|
assert.equal(input.__value, 'abc');
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,6 @@
|
|||||||
|
<script>
|
||||||
|
export let props;
|
||||||
|
let radioValue;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<input type="radio" {...props} bind:group={radioValue} />
|
Loading…
Reference in new issue