mirror of
https://github.com/home-assistant/frontend.git
synced 2026-04-20 17:43:36 +00:00
Fix regressions for search inputs with focus scrollable changes (#51484)
This commit is contained in:
@@ -16,6 +16,7 @@ import { styleMap } from "lit/directives/style-map";
|
||||
import memoizeOne from "memoize-one";
|
||||
import { STRINGS_SEPARATOR_DOT } from "../../common/const";
|
||||
import { restoreScroll } from "../../common/decorators/restore-scroll";
|
||||
import { deepActiveElement } from "../../common/dom/deep-active-element";
|
||||
import { fireEvent } from "../../common/dom/fire_event";
|
||||
import type {
|
||||
HASSDomCurrentTargetEvent,
|
||||
@@ -265,11 +266,13 @@ export class HaDataTable extends LitElement {
|
||||
this.style.removeProperty("--table-row-width");
|
||||
}
|
||||
|
||||
const activeElement = deepActiveElement();
|
||||
|
||||
if (
|
||||
changedProps.has("selectable") ||
|
||||
(!this.autoHeight &&
|
||||
document.activeElement &&
|
||||
AUTO_FOCUS_ALLOWED_ACTIVE_TAGS.includes(document.activeElement.tagName))
|
||||
activeElement &&
|
||||
AUTO_FOCUS_ALLOWED_ACTIVE_TAGS.includes(activeElement.tagName))
|
||||
) {
|
||||
this._focusScroller();
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import { navigate } from "../../../common/navigate";
|
||||
import { caseInsensitiveStringCompare } from "../../../common/string/compare";
|
||||
import { extractSearchParam } from "../../../common/url/search-params";
|
||||
import { nextRender } from "../../../common/util/render-status";
|
||||
import { deepActiveElement } from "../../../common/dom/deep-active-element";
|
||||
import "../../../components/ha-button";
|
||||
import "../../../components/ha-checkbox";
|
||||
import "../../../components/ha-dropdown";
|
||||
@@ -428,6 +429,17 @@ class HaConfigIntegrationsDashboard extends KeyboardShortcutMixin(
|
||||
}
|
||||
|
||||
if (this.configEntries && this.configEntriesInProgress) {
|
||||
const activeElement = deepActiveElement();
|
||||
|
||||
if (
|
||||
activeElement instanceof HTMLInputElement ||
|
||||
activeElement instanceof HTMLTextAreaElement ||
|
||||
activeElement instanceof HTMLSelectElement ||
|
||||
(activeElement as HTMLElement | null)?.isContentEditable
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._tabsSubpage?.focusContentScroller();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user