From b3141a0653631b0b23d6f4d1562968ddaa44ed43 Mon Sep 17 00:00:00 2001 From: karwosts <32912880+karwosts@users.noreply.github.com> Date: Wed, 22 Jan 2025 00:03:23 -0800 Subject: [PATCH] Remember selection "Don't Group" in data-tables (#23836) --- src/panels/config/automation/ha-automation-picker.ts | 4 ++-- src/panels/config/helpers/ha-config-helpers.ts | 4 ++-- src/panels/config/scene/ha-scene-dashboard.ts | 4 ++-- src/panels/config/script/ha-script-picker.ts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/panels/config/automation/ha-automation-picker.ts b/src/panels/config/automation/ha-automation-picker.ts index 88dd05424c..98777230c4 100644 --- a/src/panels/config/automation/ha-automation-picker.ts +++ b/src/panels/config/automation/ha-automation-picker.ts @@ -538,7 +538,7 @@ class HaAutomationPicker extends SubscribeMixin(LitElement) { this.hass.localize, this.hass.locale )} - .initialGroupColumn=${this._activeGrouping || "category"} + .initialGroupColumn=${this._activeGrouping ?? "category"} .initialCollapsedGroups=${this._activeCollapsed} .initialSorting=${this._activeSorting} .columnOrder=${this._activeColumnOrder} @@ -1417,7 +1417,7 @@ ${rejected } private _handleGroupingChanged(ev: CustomEvent) { - this._activeGrouping = ev.detail.value; + this._activeGrouping = ev.detail.value ?? ""; } private _handleCollapseChanged(ev: CustomEvent) { diff --git a/src/panels/config/helpers/ha-config-helpers.ts b/src/panels/config/helpers/ha-config-helpers.ts index a2afa1a3e7..a9876f8917 100644 --- a/src/panels/config/helpers/ha-config-helpers.ts +++ b/src/panels/config/helpers/ha-config-helpers.ts @@ -656,7 +656,7 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) { ).length} .columns=${this._columns(this.hass.localize)} .data=${helpers} - .initialGroupColumn=${this._activeGrouping || "category"} + .initialGroupColumn=${this._activeGrouping ?? "category"} .initialCollapsedGroups=${this._activeCollapsed} .initialSorting=${this._activeSorting} .columnOrder=${this._activeColumnOrder} @@ -1264,7 +1264,7 @@ ${rejected } private _handleGroupingChanged(ev: CustomEvent) { - this._activeGrouping = ev.detail.value; + this._activeGrouping = ev.detail.value ?? ""; } private _handleCollapseChanged(ev: CustomEvent) { diff --git a/src/panels/config/scene/ha-scene-dashboard.ts b/src/panels/config/scene/ha-scene-dashboard.ts index 2fc0888911..ef1563fe21 100644 --- a/src/panels/config/scene/ha-scene-dashboard.ts +++ b/src/panels/config/scene/ha-scene-dashboard.ts @@ -552,7 +552,7 @@ class HaSceneDashboard extends SubscribeMixin(LitElement) { ).length} .columns=${this._columns(this.hass.localize)} id="entity_id" - .initialGroupColumn=${this._activeGrouping || "category"} + .initialGroupColumn=${this._activeGrouping ?? "category"} .initialCollapsedGroups=${this._activeCollapsed} .initialSorting=${this._activeSorting} .columnOrder=${this._activeColumnOrder} @@ -1163,7 +1163,7 @@ ${rejected } private _handleGroupingChanged(ev: CustomEvent) { - this._activeGrouping = ev.detail.value; + this._activeGrouping = ev.detail.value ?? ""; } private _handleCollapseChanged(ev: CustomEvent) { diff --git a/src/panels/config/script/ha-script-picker.ts b/src/panels/config/script/ha-script-picker.ts index 3e8bb92f73..2cd3293317 100644 --- a/src/panels/config/script/ha-script-picker.ts +++ b/src/panels/config/script/ha-script-picker.ts @@ -527,7 +527,7 @@ class HaScriptPicker extends SubscribeMixin(LitElement) { { number: scripts.length } )} has-filters - .initialGroupColumn=${this._activeGrouping || "category"} + .initialGroupColumn=${this._activeGrouping ?? "category"} .initialCollapsedGroups=${this._activeCollapsed} .initialSorting=${this._activeSorting} .columnOrder=${this._activeColumnOrder} @@ -1255,7 +1255,7 @@ ${rejected } private _handleGroupingChanged(ev: CustomEvent) { - this._activeGrouping = ev.detail.value; + this._activeGrouping = ev.detail.value ?? ""; } private _handleCollapseChanged(ev: CustomEvent) {