From 0b6e35eb530f6a1d406a23b738b39ec19e154e1e Mon Sep 17 00:00:00 2001 From: ildar170975 <71872483+ildar170975@users.noreply.github.com> Date: Thu, 27 Nov 2025 10:54:38 +0300 Subject: [PATCH] Data tables: make sorting direction 2-state instead of 3-state (#28160) * sorting is 2-state * sorting is 2-state * sorting is 2-state --- src/components/data-table/ha-data-table.ts | 4 ++-- src/layouts/hass-tabs-subpage-data-table.ts | 4 ++-- .../developer-tools/statistics/developer-tools-statistics.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) 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) {