fix removing attributes in spreads

pull/3775/head
Conduitry 6 years ago
parent 0c6347a3cb
commit 73e7165aba

@ -93,7 +93,9 @@ export function set_attributes(node: Element & ElementCSSInlineStyle, attributes
// @ts-ignore
const descriptors = Object.getOwnPropertyDescriptors(node.__proto__);
for (const key in attributes) {
if (key === 'style') {
if (attributes[key] == null) {
node.removeAttribute(key);
} else if (key === 'style') {
node.style.cssText = attributes[key];
} else if (descriptors[key] && descriptors[key].set) {
node[key] = attributes[key];

@ -0,0 +1,3 @@
export default {
html: `<input>`
};

@ -0,0 +1 @@
<input placeholder='foo' {...{ placeholder: null }}>
Loading…
Cancel
Save