diff --git a/src/components/data-table/ha-data-table.ts b/src/components/data-table/ha-data-table.ts index 8ca1d6f68b..6aa6233b6d 100644 --- a/src/components/data-table/ha-data-table.ts +++ b/src/components/data-table/ha-data-table.ts @@ -349,6 +349,7 @@ export class HaDataTable extends LitElement { class="mdc-data-table__content scroller ha-scrollbar" @scroll=${this._saveScrollPos} .items=${this._items} + .keyFunction=${this._keyFunction} .renderItem=${this._renderRow} > `} @@ -357,6 +358,8 @@ export class HaDataTable extends LitElement { `; } + private _keyFunction = (row: DataTableRowData) => row[this.id] || row; + private _renderRow = (row: DataTableRowData, index: number) => { // not sure how this happens... if (!row) {