1
0
mirror of https://github.com/home-assistant/frontend.git synced 2026-02-15 07:25:54 +00:00

Implement fallback for dialog close event in Quick Search (#29260)

This commit is contained in:
Wendelin
2026-01-29 17:41:12 +01:00
committed by Bram Kragten
parent 812f3ca8b9
commit 55f22ba61a

View File

@@ -171,6 +171,18 @@ export class QuickBar extends LitElement {
fireEvent(this, "dialog-closed", { dialog: this.localName });
};
// fallback in case the closed event is not fired
private _dialogCloseStarted = () => {
setTimeout(
() => {
if (this._opened) {
this._dialogClosed();
}
},
350 // close animation timeout is 300ms
);
};
// #endregion lifecycle
// #region render
@@ -226,6 +238,7 @@ export class QuickBar extends LitElement {
hideActions
@wa-show=${this._showTriggered}
@wa-after-show=${this._dialogOpened}
@wa-hide=${this._dialogCloseStarted}
@closed=${this._dialogClosed}
>
${!this._loading && this._opened