Fix automation sidebar editor rerendering (#27607)

This commit is contained in:
Wendelin
2025-10-23 16:06:53 +02:00
committed by GitHub
parent e388756533
commit 77735f5310
8 changed files with 22 additions and 10 deletions

View File

@@ -89,7 +89,7 @@ export class HaManualScriptEditor extends LitElement {
@state() private _sidebarConfig?: SidebarConfig;
@state() private _sidebarKey?: string;
@state() private _sidebarKey = 0;
@storage({
key: "automation-sidebar-width",
@@ -512,7 +512,9 @@ export class HaManualScriptEditor extends LitElement {
// deselect previous selected row
this._sidebarConfig?.close?.();
this._sidebarConfig = ev.detail;
this._sidebarKey = JSON.stringify(this._sidebarConfig);
// be sure the sidebar editor is recreated
this._sidebarKey++;
await this._sidebarElement?.updateComplete;
this._sidebarElement?.focus();
@@ -537,6 +539,7 @@ export class HaManualScriptEditor extends LitElement {
return;
}
this._sidebarConfig?.close();
this._sidebarKey = 0;
}
}