0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00

Fixes setting custom element data to zero

This commit is contained in:
Dominik Winkelbauer 2018-11-14 11:21:12 +01:00 committed by GitHub
parent 28dd6a899a
commit a4bc7c5a26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -101,7 +101,7 @@ export function setAttributes(node, attributes) {
export function setCustomElementData(node, prop, value) {
if (prop in node) {
node[prop] = value;
} else if (value) {
} else if (value != null) {
setAttribute(node, prop, value);
} else {
node.removeAttribute(prop);