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,11 +109,14 @@ 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) {
for (const element of this._elements) { this.removeChild(child);
this.appendChild(element); child = this.lastElementChild;
} }
for (const element of this._elements) {
this.appendChild(element);
} }
this.style.display = "inline"; this.style.display = "inline";