Return focus after dialogs close (#11999)

This commit is contained in:
Steve Repsher
2022-05-16 11:10:41 -04:00
committed by GitHub
parent 1bd760b455
commit ae2d48f2f4
7 changed files with 150 additions and 15 deletions

View File

@@ -4,6 +4,7 @@ import { mdiClose } from "@mdi/js";
import { css, html, TemplateResult } from "lit";
import { customElement } from "lit/decorators";
import type { HomeAssistant } from "../types";
import { FOCUS_TARGET } from "../dialogs/make-dialog-manager";
import "./ha-icon-button";
export const createCloseHeading = (
@@ -21,6 +22,8 @@ export const createCloseHeading = (
@customElement("ha-dialog")
export class HaDialog extends DialogBase {
protected readonly [FOCUS_TARGET];
public scrollToPos(x: number, y: number) {
this.contentElement?.scrollTo(x, y);
}