Fix hidden entity filter card in section (#20117)

This commit is contained in:
Paul Bottein 2024-03-19 10:24:12 +01:00 committed by GitHub
parent 8a4ed121b5
commit cbc150bad2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -151,6 +151,7 @@ export class HuiEntityFilterCard
if (entitiesList.length === 0 && this._config.show_empty === false) {
this.style.display = "none";
this.toggleAttribute("hidden", true);
return;
}
@ -181,6 +182,7 @@ export class HuiEntityFilterCard
}
this.style.display = "block";
this.toggleAttribute("hidden", false);
}
private _haveEntitiesChanged(oldHass: HomeAssistant | null): boolean {

View File

@ -33,8 +33,6 @@ export class HuiConditionalBase extends ReactiveElement {
@property({ type: Boolean }) public editMode = false;
@property({ type: Boolean, reflect: true }) public hidden = false;
@state() protected _config?: ConditionalCardConfig | ConditionalRowConfig;
protected _element?: LovelaceCard | LovelaceRow;
@ -151,7 +149,7 @@ export class HuiConditionalBase extends ReactiveElement {
return;
}
const visible = this.editMode || conditionMet;
this.hidden = !visible;
this.toggleAttribute("hidden", !visible);
this.style.setProperty("display", visible ? "" : "none");
if (visible) {