fix: prevent duplicates

pull/16481/head
daimond113 1 month ago
parent 6f6a24a8dc
commit 44ac3a9950
No known key found for this signature in database

@ -205,8 +205,10 @@ export function spread_attributes(attrs, css_hash, classes, styles, flags = 0) {
if (!ignore_defaults) {
if (name === 'defaultvalue') {
name = 'value';
if (attrs[name]) continue;
} else if (name === 'defaultchecked') {
name = 'checked';
if (attrs[name]) continue;
}
}

@ -5,5 +5,6 @@ export default test({
html: `
<input value="a">
<input type="checkbox" checked>
<input value="b">
`
});

@ -4,4 +4,5 @@
</script>
<input {...text} />
<input type="checkbox" {...checkbox} />
<input type="checkbox" {...checkbox} />
<input value="b" {...text} />
Loading…
Cancel
Save