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;
}
// Attach element if it has never been attached.
if (!this.lastChild) {
let child = this.lastElementChild;
while (child) {
this.removeChild(child);
child = this.lastElementChild;
}
for (const element of this._elements) {
this.appendChild(element);
}
}
this.style.display = "inline";
}