Skip to content

Commit 0b6e35e

Browse files
authored
Data tables: make sorting direction 2-state instead of 3-state (#28160)
* sorting is 2-state * sorting is 2-state * sorting is 2-state
1 parent e80a855 commit 0b6e35e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/components/data-table/ha-data-table.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,10 +838,10 @@ export class HaDataTable extends LitElement {
838838
} else if (this.sortDirection === "asc") {
839839
this.sortDirection = "desc";
840840
} else {
841-
this.sortDirection = null;
841+
this.sortDirection = "asc";
842842
}
843843

844-
this.sortColumn = this.sortDirection === null ? undefined : columnId;
844+
this.sortColumn = columnId;
845845

846846
fireEvent(this, "sorting-changed", {
847847
column: columnId,

src/layouts/hass-tabs-subpage-data-table.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,9 +621,9 @@ export class HaTabsSubpageDataTable extends KeyboardShortcutMixin(LitElement) {
621621
} else if (this._sortDirection === "asc") {
622622
this._sortDirection = "desc";
623623
} else {
624-
this._sortDirection = null;
624+
this._sortDirection = "asc";
625625
}
626-
this._sortColumn = this._sortDirection === null ? undefined : columnId;
626+
this._sortColumn = columnId;
627627

628628
fireEvent(this, "sorting-changed", {
629629
column: columnId,

src/panels/developer-tools/statistics/developer-tools-statistics.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,9 +547,9 @@ class HaPanelDevStatistics extends KeyboardShortcutMixin(LitElement) {
547547
} else if (this._sortDirection === "asc") {
548548
this._sortDirection = "desc";
549549
} else {
550-
this._sortDirection = null;
550+
this._sortDirection = "asc";
551551
}
552-
this._sortColumn = this._sortDirection === null ? undefined : columnId;
552+
this._sortColumn = columnId;
553553
}
554554

555555
private _handleGroupBy(ev) {

0 commit comments

Comments
 (0)