mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-30 13:17:19 +00:00
Fix automation add TCA autofocus (#28168)
Fix automation add tca autofocus
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
import "@home-assistant/webawesome/dist/components/dialog/dialog";
|
||||||
|
import { mdiClose } from "@mdi/js";
|
||||||
import { css, html, LitElement } from "lit";
|
import { css, html, LitElement } from "lit";
|
||||||
import {
|
import {
|
||||||
customElement,
|
customElement,
|
||||||
@@ -7,8 +9,6 @@ import {
|
|||||||
state,
|
state,
|
||||||
} from "lit/decorators";
|
} from "lit/decorators";
|
||||||
import { ifDefined } from "lit/directives/if-defined";
|
import { ifDefined } from "lit/directives/if-defined";
|
||||||
import { mdiClose } from "@mdi/js";
|
|
||||||
import "@home-assistant/webawesome/dist/components/dialog/dialog";
|
|
||||||
import { fireEvent } from "../common/dom/fire_event";
|
import { fireEvent } from "../common/dom/fire_event";
|
||||||
import { haStyleScrollbar } from "../resources/styles";
|
import { haStyleScrollbar } from "../resources/styles";
|
||||||
import type { HomeAssistant } from "../types";
|
import type { HomeAssistant } from "../types";
|
||||||
@@ -172,7 +172,9 @@ export class HaWaDialog extends LitElement {
|
|||||||
|
|
||||||
await this.updateComplete;
|
await this.updateComplete;
|
||||||
|
|
||||||
(this.querySelector("[autofocus]") as HTMLElement | null)?.focus();
|
requestAnimationFrame(() => {
|
||||||
|
(this.querySelector("[autofocus]") as HTMLElement | null)?.focus();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
private _handleAfterShow = () => {
|
private _handleAfterShow = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user