Fix empty line in data table when using group_by (#20273)

This commit is contained in:
Paul Bottein
2024-03-29 16:16:01 +01:00
committed by GitHub
parent 99695d6cb3
commit abd02eda0f

View File

@@ -512,10 +512,6 @@ export class HaDataTable extends LitElement {
items.push({ append: true, content: this.appendRow });
}
if (this.hasFab) {
items.push({ empty: true });
}
if (this.groupColumn) {
const grouped = groupBy(items, (item) => item[this.groupColumn!]);
if (grouped.undefined) {
@@ -555,6 +551,10 @@ export class HaDataTable extends LitElement {
} else {
this._items = items;
}
if (this.hasFab) {
this._items = [...this._items, { empty: true }];
}
} else {
this._items = data;
}