Fix automation narrow bottom sheet close animation (#26850)

This commit is contained in:
Wendelin
2025-09-03 11:45:13 +02:00
committed by GitHub
parent 70a2ca281f
commit 14a7813ab0
8 changed files with 33 additions and 31 deletions

View File

@@ -170,6 +170,7 @@ export class HaManualScriptEditor extends LitElement {
.disabled=${this.disabled}
.narrow=${this.narrow}
@open-sidebar=${this._openSidebar}
@request-close-sidebar=${this._triggerCloseSidebar}
@close-sidebar=${this._handleCloseSidebar}
></ha-script-fields>`
: nothing
@@ -200,6 +201,7 @@ export class HaManualScriptEditor extends LitElement {
.highlightedActions=${this._pastedConfig?.sequence || []}
@value-changed=${this._sequenceChanged}
@open-sidebar=${this._openSidebar}
@request-close-sidebar=${this._triggerCloseSidebar}
@close-sidebar=${this._handleCloseSidebar}
.hass=${this.hass}
.narrow=${this.narrow}
@@ -506,11 +508,13 @@ export class HaManualScriptEditor extends LitElement {
};
}
private _closeSidebar() {
private _triggerCloseSidebar() {
if (this._sidebarConfig) {
const closeRow = this._sidebarConfig?.close;
this._sidebarConfig = undefined;
closeRow?.();
if (this._sidebarElement) {
this._sidebarElement.triggerCloseSidebar();
return;
}
this._sidebarConfig?.close();
}
}
@@ -519,7 +523,7 @@ export class HaManualScriptEditor extends LitElement {
}
private _saveScript() {
this._closeSidebar();
this._triggerCloseSidebar();
fireEvent(this, "save-script");
}