Skip to content

Commit

Permalink
Fix conditional chip not displayed in editor (#1465)
Browse files Browse the repository at this point in the history
  • Loading branch information
piitaya committed Jul 9, 2024
1 parent e1bf082 commit d2e6dce
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 69 deletions.
5 changes: 4 additions & 1 deletion src/cards/chips-card/chips-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ export class ChipsCard extends LitElement implements LovelaceCard {
};
}

@property() public preview?: boolean;

@property() public editMode?: boolean;

@state() private _config?: ChipsCardConfig;
Expand Down Expand Up @@ -100,8 +102,9 @@ export class ChipsCard extends LitElement implements LovelaceCard {
}
if (this._hass) {
element.hass = this._hass;
element.editMode = this.editMode;
}
element.editMode = this.editMode || this.preview;
element.preview = this.preview || this.editMode;
return html`${element}`;
}

Expand Down
68 changes: 0 additions & 68 deletions src/utils/conditional/conditional-base.ts

This file was deleted.

1 change: 1 addition & 0 deletions src/utils/lovelace/chip/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Info } from "../../info";
export interface LovelaceChip extends HTMLElement {
hass?: HomeAssistant;
editMode?: boolean;
preview?: boolean;
setConfig(config: LovelaceChipConfig);
}

Expand Down

0 comments on commit d2e6dce

Please sign in to comment.