From cbb962f08483532e58e2f346db2bc779185e38b8 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 26 May 2022 23:59:26 +0200 Subject: [PATCH] Fix width of application creds page (#12806) --- src/components/ha-combo-box.ts | 22 ++++++++++--------- .../ha-config-application-credentials.ts | 1 - 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/components/ha-combo-box.ts b/src/components/ha-combo-box.ts index a6e1fb1d4a..f900c2fa9f 100644 --- a/src/components/ha-combo-box.ts +++ b/src/components/ha-combo-box.ts @@ -1,13 +1,17 @@ import "@material/mwc-list/mwc-list-item"; import { mdiClose, mdiMenuDown, mdiMenuUp } from "@mdi/js"; import "@vaadin/combo-box/theme/material/vaadin-combo-box-light"; -import type { ComboBoxLight } from "@vaadin/combo-box/vaadin-combo-box-light"; +import type { + ComboBoxLight, + ComboBoxLightFilterChangedEvent, + ComboBoxLightOpenedChangedEvent, + 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 { ComboBoxLitRenderer, comboBoxRenderer } from "lit-vaadin-helpers"; import { customElement, property, query } from "lit/decorators"; import { fireEvent } from "../common/dom/fire_event"; -import { PolymerChangedEvent } from "../polymer-types"; import { HomeAssistant } from "../types"; import "./ha-icon-button"; import "./ha-textfield"; @@ -203,7 +207,7 @@ export class HaComboBox extends LitElement { } } - private _openedChanged(ev: PolymerChangedEvent) { + private _openedChanged(ev: ComboBoxLightOpenedChangedEvent) { const opened = ev.detail.value; // delay this so we can handle click event before setting _opened setTimeout(() => { @@ -229,14 +233,12 @@ export class HaComboBox extends LitElement { mutations.forEach((mutation) => { if ( mutation.type === "attributes" && - mutation.attributeName === "inert" && - // @ts-expect-error - overlay.inert === true + mutation.attributeName === "inert" ) { - // @ts-expect-error - overlay.inert = false; this._overlayMutationObserver?.disconnect(); this._overlayMutationObserver = undefined; + // @ts-expect-error + overlay.inert = false; } else if (mutation.type === "childList") { mutation.removedNodes.forEach((node) => { if (node.nodeName === "VAADIN-COMBO-BOX-OVERLAY") { @@ -257,12 +259,12 @@ export class HaComboBox extends LitElement { } } - private _filterChanged(ev: PolymerChangedEvent) { + private _filterChanged(ev: ComboBoxLightFilterChangedEvent) { // @ts-ignore fireEvent(this, ev.type, ev.detail, { composed: false }); } - private _valueChanged(ev: PolymerChangedEvent) { + private _valueChanged(ev: ComboBoxLightValueChangedEvent) { ev.stopPropagation(); const newValue = ev.detail.value; diff --git a/src/panels/config/application_credentials/ha-config-application-credentials.ts b/src/panels/config/application_credentials/ha-config-application-credentials.ts index 79d947ca4e..bacd283923 100644 --- a/src/panels/config/application_credentials/ha-config-application-credentials.ts +++ b/src/panels/config/application_credentials/ha-config-application-credentials.ts @@ -53,7 +53,6 @@ export class HaConfigApplicationCredentials extends LitElement { title: localize( "ui.panel.config.application_credentials.picker.headers.name" ), - width: "40%", direction: "asc", grows: true, template: (_, entry: ApplicationCredential) => html`${entry.name}`,