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

pull/7738/head
Daniel Imfeld 5 years ago committed by GitHub
parent 4597d72460
commit c2e22229f9

@ -98,7 +98,9 @@ export function set_attributes(node: Element & ElementCSSInlineStyle, attributes
node.removeAttribute(key); node.removeAttribute(key);
} else if (key === 'style') { } else if (key === 'style') {
node.style.cssText = attributes[key]; 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]; node[key] = attributes[key];
} else { } else {
attr(node, key, attributes[key]); 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