mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 19:26:36 +00:00
Fix grid card size when square (#9056)
This commit is contained in:
parent
d57e8a45d3
commit
92b32458ad
@ -143,6 +143,15 @@ const CONFIGS = [
|
||||
entity: light.kitchen_lights
|
||||
`,
|
||||
},
|
||||
{
|
||||
heading: "Size for single card",
|
||||
config: `
|
||||
- type: grid
|
||||
cards:
|
||||
- type: entity
|
||||
entity: light.kitchen_lights
|
||||
`,
|
||||
},
|
||||
|
||||
{
|
||||
heading: "Vertical Stack",
|
||||
|
@ -25,7 +25,9 @@ class HuiGridCard extends HuiStackCard<GridCardConfig> {
|
||||
if (this.square) {
|
||||
const rowHeight = SQUARE_ROW_HEIGHTS_BY_COLUMNS[this.columns] || 1;
|
||||
return (
|
||||
(this._cards.length / this.columns) * rowHeight +
|
||||
(this._cards.length < this.columns
|
||||
? rowHeight
|
||||
: (this._cards.length / this.columns) * rowHeight) +
|
||||
(this._config.title ? 1 : 0)
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user