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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user