Skip to content

Commit

Permalink
Set min column size to 1 for vertical tile card (#21275)
Browse files Browse the repository at this point in the history
  • Loading branch information
piitaya authored Jul 3, 2024
1 parent e332364 commit 1ceef7c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/panels/lovelace/cards/hui-tile-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,19 +123,21 @@ export class HuiTileCard extends LitElement implements LovelaceCard {

public getLayoutOptions(): LovelaceLayoutOptions {
const grid_columns = 2;
let grid_min_columns = 2;
let grid_rows = 1;
if (this._config?.features?.length) {
const featureHeight = Math.ceil((this._config.features.length * 2) / 3);
grid_rows += featureHeight;
}
if (this._config?.vertical) {
grid_rows!++;
grid_rows++;
grid_min_columns = 1;
}
return {
grid_columns,
grid_rows,
grid_min_rows: grid_rows,
grid_min_columns: grid_columns,
grid_min_columns,
};
}

Expand Down

0 comments on commit 1ceef7c

Please sign in to comment.