Skip to content

Commit

Permalink
Improve get card size
Browse files Browse the repository at this point in the history
  • Loading branch information
piitaya committed Mar 5, 2024
1 parent f158a14 commit 91851df
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/cards/template-card/template-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,13 @@ export class TemplateCard extends MushroomBaseElement implements LovelaceCard {
protected _inGrid = false;

public getCardSize(): number | Promise<number> {
return 1;
let height = 1;
if (!this._config) return height;
const appearance = computeAppearance(this._config);
if (appearance.layout === "vertical") {
height += 1;
}
return height;
}

public getGridSize(): [number, number] {
Expand Down

0 comments on commit 91851df

Please sign in to comment.