diff --git a/lib/mixins/properties-changed.js b/lib/mixins/properties-changed.js index 94147a436c..b81844b828 100644 --- a/lib/mixins/properties-changed.js +++ b/lib/mixins/properties-changed.js @@ -497,12 +497,12 @@ export const PropertiesChanged = dedupingMixin( */ _valueToNodeAttribute(node, value, attribute) { const str = this._serializeValue(value); + if (attribute === 'class' || attribute === 'name' || attribute === 'slot') { + node = /** @type {?Element} */(wrap(node)); + } if (str === undefined) { node.removeAttribute(attribute); } else { - if (attribute === 'class' || attribute === 'name' || attribute === 'slot') { - node = /** @type {?Element} */(wrap(node)); - } node.setAttribute(attribute, str); } }