diff --git a/src/components/ha-combo-box.ts b/src/components/ha-combo-box.ts index 3b98083608..adbb06a1bd 100644 --- a/src/components/ha-combo-box.ts +++ b/src/components/ha-combo-box.ts @@ -8,7 +8,14 @@ import type { ComboBoxLightValueChangedEvent, } from "@vaadin/combo-box/vaadin-combo-box-light"; import { registerStyles } from "@vaadin/vaadin-themable-mixin/register-styles"; -import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { + css, + CSSResultGroup, + html, + LitElement, + PropertyValues, + TemplateResult, +} from "lit"; import { ComboBoxLitRenderer, comboBoxRenderer } from "@vaadin/combo-box/lit"; import { customElement, property, query } from "lit/decorators"; import { ifDefined } from "lit/directives/if-defined"; @@ -225,11 +232,13 @@ export class HaComboBox extends LitElement { // @ts-ignore fireEvent(this, ev.type, ev.detail); - if ( - opened && - "MutationObserver" in window && - !this._overlayMutationObserver - ) { + if (opened) { + this.removeInertOnOverlay(); + } + } + + private removeInertOnOverlay() { + if ("MutationObserver" in window && !this._overlayMutationObserver) { const overlay = document.querySelector( "vaadin-combo-box-overlay" ); @@ -268,6 +277,16 @@ export class HaComboBox extends LitElement { } } + updated(changedProps: PropertyValues) { + super.updated(changedProps); + if ( + changedProps.has("filteredItems") || + (changedProps.has("items") && this.opened) + ) { + this.removeInertOnOverlay(); + } + } + private _filterChanged(ev: ComboBoxLightFilterChangedEvent) { // @ts-ignore fireEvent(this, ev.type, ev.detail, { composed: false }); diff --git a/src/components/ha-icon-picker.ts b/src/components/ha-icon-picker.ts index 3f43d497e0..a424ffeda1 100644 --- a/src/components/ha-icon-picker.ts +++ b/src/components/ha-icon-picker.ts @@ -13,7 +13,7 @@ type IconItem = { icon: string; keywords: string[]; }; -let iconItems: IconItem[] = [{ icon: "", keywords: [] }]; +let iconItems: IconItem[] = []; let iconLoaded = false; // eslint-disable-next-line lit/prefer-static-styles diff --git a/src/components/ha-navigation-picker.ts b/src/components/ha-navigation-picker.ts index 84c1084b30..a9226d1e5e 100644 --- a/src/components/ha-navigation-picker.ts +++ b/src/components/ha-navigation-picker.ts @@ -20,7 +20,7 @@ type NavigationItem = { title: string; }; -const DEFAULT_ITEMS: NavigationItem[] = [{ path: "", icon: "", title: "" }]; +const DEFAULT_ITEMS: NavigationItem[] = []; // eslint-disable-next-line lit/prefer-static-styles const rowRenderer: ComboBoxLitRenderer = (item) => html`