Fix entity-filter-badge update

This commit is contained in:
Ian Richardson 2019-11-15 09:45:50 -06:00
parent 1c614c855f
commit 89f33a1730

View File

@ -109,12 +109,15 @@ class EntityFilterBadge extends HTMLElement implements LovelaceBadge {
return; return;
} }
// Attach element if it has never been attached. let child = this.lastElementChild;
if (!this.lastChild) { while (child) {
this.removeChild(child);
child = this.lastElementChild;
}
for (const element of this._elements) { for (const element of this._elements) {
this.appendChild(element); this.appendChild(element);
} }
}
this.style.display = "inline"; this.style.display = "inline";
} }