Remove null and undefined attributes

set_attributes() should delete `null` or `undefined` attributes.

I meet the issue for this case
```
<script>
	let size
</script>
<input type="text" { size } />
vs
<input type="text" { ...{ size } } />
```
pull/3235/head
Vadim Cebaniuc 6 years ago committed by GitHub
parent 2b79a2269d
commit 76b6a6ec1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -100,7 +100,7 @@ export function set_attributes(node: Element & ElementCSSInlineStyle, attributes
for (const key in attributes) {
if (key === 'style') {
node.style.cssText = attributes[key];
} else if (key in node) {
} else if (key in node && attributes[key] != null) {
node[key] = attributes[key];
} else {
attr(node, key, attributes[key]);

Loading…
Cancel
Save