From 1ef13c5100d2bd690f688e59bf98e76f548979e4 Mon Sep 17 00:00:00 2001 From: Wendelin <12148533+wendevlin@users.noreply.github.com> Date: Tue, 31 Mar 2026 13:36:56 +0200 Subject: [PATCH] Fix automation add TCA dialog sometimes not opening (#51306) --- .../config/automation/add-automation-element-dialog.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/panels/config/automation/add-automation-element-dialog.ts b/src/panels/config/automation/add-automation-element-dialog.ts index d6affb018e..1b9a6a4180 100644 --- a/src/panels/config/automation/add-automation-element-dialog.ts +++ b/src/panels/config/automation/add-automation-element-dialog.ts @@ -289,6 +289,7 @@ class DialogAddAutomationElement public showDialog(params): void { this._params = params; + this._resetVariables(); this.addKeyboardShortcuts(); @@ -378,9 +379,15 @@ class DialogAddAutomationElement if (this._params) { fireEvent(this, "dialog-closed", { dialog: this.localName }); } + this._params = undefined; + this._resetVariables(); + + return true; + } + + private _resetVariables() { this._open = true; this._closing = false; - this._params = undefined; this._selectedCollectionIndex = undefined; this._selectedGroup = undefined; this._selectedTarget = undefined; @@ -392,7 +399,6 @@ class DialogAddAutomationElement this._narrow = false; this._targetItems = undefined; this._loadItemsError = false; - return true; } private _updateNarrow = () => {