diff --git a/src/components/data-table/ha-data-table.ts b/src/components/data-table/ha-data-table.ts index a41d71a17e..81e460b0c4 100644 --- a/src/components/data-table/ha-data-table.ts +++ b/src/components/data-table/ha-data-table.ts @@ -838,10 +838,10 @@ export class HaDataTable extends LitElement { } else if (this.sortDirection === "asc") { this.sortDirection = "desc"; } else { - this.sortDirection = null; + this.sortDirection = "asc"; } - this.sortColumn = this.sortDirection === null ? undefined : columnId; + this.sortColumn = columnId; fireEvent(this, "sorting-changed", { column: columnId, diff --git a/src/layouts/hass-tabs-subpage-data-table.ts b/src/layouts/hass-tabs-subpage-data-table.ts index 7290a76e20..d2f193fad1 100644 --- a/src/layouts/hass-tabs-subpage-data-table.ts +++ b/src/layouts/hass-tabs-subpage-data-table.ts @@ -621,9 +621,9 @@ export class HaTabsSubpageDataTable extends KeyboardShortcutMixin(LitElement) { } else if (this._sortDirection === "asc") { this._sortDirection = "desc"; } else { - this._sortDirection = null; + this._sortDirection = "asc"; } - this._sortColumn = this._sortDirection === null ? undefined : columnId; + this._sortColumn = columnId; fireEvent(this, "sorting-changed", { column: columnId, diff --git a/src/panels/developer-tools/statistics/developer-tools-statistics.ts b/src/panels/developer-tools/statistics/developer-tools-statistics.ts index 32210ddc89..6ff053c8a5 100644 --- a/src/panels/developer-tools/statistics/developer-tools-statistics.ts +++ b/src/panels/developer-tools/statistics/developer-tools-statistics.ts @@ -547,9 +547,9 @@ class HaPanelDevStatistics extends KeyboardShortcutMixin(LitElement) { } else if (this._sortDirection === "asc") { this._sortDirection = "desc"; } else { - this._sortDirection = null; + this._sortDirection = "asc"; } - this._sortColumn = this._sortDirection === null ? undefined : columnId; + this._sortColumn = columnId; } private _handleGroupBy(ev) {