Skip to content

Commit

Permalink
Fix hidden entity filter card in section (#20117)
Browse files Browse the repository at this point in the history
  • Loading branch information
piitaya authored Mar 19, 2024
1 parent 8a4ed12 commit cbc150b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/panels/lovelace/cards/hui-entity-filter-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -181,6 +182,7 @@ export class HuiEntityFilterCard
}

this.style.display = "block";
this.toggleAttribute("hidden", false);
}

private _haveEntitiesChanged(oldHass: HomeAssistant | null): boolean {
Expand Down
4 changes: 1 addition & 3 deletions src/panels/lovelace/components/hui-conditional-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit cbc150b

Please sign in to comment.