diff --git a/src/components/ha-grid-size-picker.ts b/src/components/ha-grid-size-picker.ts
index 453a24cb8d30..bcdc000fa684 100644
--- a/src/components/ha-grid-size-picker.ts
+++ b/src/components/ha-grid-size-picker.ts
@@ -10,7 +10,7 @@ import { HomeAssistant } from "../types";
import { conditionalClamp } from "../common/number/clamp";
type GridSizeValue = {
- rows?: number;
+ rows?: number | "auto";
columns?: number;
};
@@ -47,6 +47,18 @@ export class HaGridSizeEditor extends LitElement {
this.columnMin !== undefined && this.columnMin === this.columnMax;
const disabledRows =
this.rowMin !== undefined && this.rowMin === this.rowMax;
+
+ const autoHeight = this._localValue?.rows === "auto";
+
+ const rowMin = this.rowMin ?? 1;
+ const rowMax = this.rowMax ?? this.rows;
+ const columnMin = this.columnMin ?? 1;
+ const columnMax = this.columnMax ?? this.columns;
+ const rowValue = autoHeight
+ ? this.rowMax ?? this.rows
+ : this._localValue?.rows;
+ const columnValue = this._localValue?.columns;
+
return html`
+
@@ -117,7 +130,7 @@ export class HaGridSizeEditor extends LitElement {
`;
})}
-
@@ -215,10 +228,6 @@ export class HaGridSizeEditor extends LitElement {
opacity: 0.2;
cursor: pointer;
}
- .preview .cell[disabled] {
- opacity: 0.05;
- cursor: initial;
- }
.selected {
pointer-events: none;
}
@@ -228,6 +237,9 @@ export class HaGridSizeEditor extends LitElement {
grid-row: 1 / span var(--rows, 0);
opacity: 0.5;
}
+ .selected.auto-height .cell {
+ opacity: 0.2;
+ }
`,
];
}
diff --git a/src/panels/lovelace/editor/card-editor/hui-card-layout-editor.ts b/src/panels/lovelace/editor/card-editor/hui-card-layout-editor.ts
index 5a5690727ce6..cc6c1ffb881c 100644
--- a/src/panels/lovelace/editor/card-editor/hui-card-layout-editor.ts
+++ b/src/panels/lovelace/editor/card-editor/hui-card-layout-editor.ts
@@ -11,8 +11,10 @@ import "../../../../components/ha-button-menu";
import "../../../../components/ha-grid-size-picker";
import "../../../../components/ha-icon-button";
import "../../../../components/ha-list-item";
+import "../../../../components/ha-settings-row";
import "../../../../components/ha-slider";
import "../../../../components/ha-svg-icon";
+import "../../../../components/ha-switch";
import "../../../../components/ha-yaml-editor";
import type { HaYamlEditor } from "../../../../components/ha-yaml-editor";
import { LovelaceCardConfig } from "../../../../data/lovelace/config/card";
@@ -61,11 +63,13 @@ export class HuiCardLayoutEditor extends LitElement {
this._defaultLayoutOptions
);
+ const sizeValue = this._gridSizeValue(options);
+
return html`