From d664269598f55c9b1d9e23972f09c6f2c9718fdf Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Tue, 28 May 2024 11:51:42 +0200 Subject: [PATCH] review suggestion --- src/components/data-table/ha-data-table.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/data-table/ha-data-table.ts b/src/components/data-table/ha-data-table.ts index 92ccad596066..f40c4a9046de 100644 --- a/src/components/data-table/ha-data-table.ts +++ b/src/components/data-table/ha-data-table.ts @@ -736,7 +736,10 @@ export class HaDataTable extends LitElement { } public collapseAllGroups() { - if (!this.groupColumn) { + if ( + !this.groupColumn || + !this.data.some((item) => item[this.groupColumn!]) + ) { return; } const grouped = groupBy(this.data, (item) => item[this.groupColumn!]);