set .value while setting .__value during spread (#4809)

pull/4835/head
Daniel Imfeld 4 years ago committed by GitHub
parent 37cc5888f8
commit 40d0ea6702
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -98,7 +98,9 @@ export function set_attributes(node: Element & ElementCSSInlineStyle, attributes
node.removeAttribute(key);
} else if (key === 'style') {
node.style.cssText = attributes[key];
} else if (key === '__value' || descriptors[key] && descriptors[key].set) {
} else if (key === '__value') {
(node as any).value = node[key] = attributes[key];
} else if (descriptors[key] && descriptors[key].set) {
node[key] = attributes[key];
} else {
attr(node, key, attributes[key]);

@ -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} />
Loading…
Cancel
Save