diff --git a/src/panels/lovelace/editor/card-editor/hui-card-picker.ts b/src/panels/lovelace/editor/card-editor/hui-card-picker.ts index d127d17a47ac..46aa25842c1e 100644 --- a/src/panels/lovelace/editor/card-editor/hui-card-picker.ts +++ b/src/panels/lovelace/editor/card-editor/hui-card-picker.ts @@ -33,6 +33,7 @@ import type { LovelaceCard } from "../../types"; import { getCardStubConfig } from "../get-card-stub-config"; import { coreCards } from "../lovelace-cards"; import type { Card, CardPickTarget } from "../types"; +import { haStyleScrollbar } from "../../../../resources/styles"; interface CardElement { card: Card; @@ -63,8 +64,6 @@ export class HuiCardPicker extends LitElement { @state() private _width?: number; - @state() private _height?: number; - private _unusedEntities?: string[]; private _usedEntities?: string[]; @@ -149,10 +148,10 @@ export class HuiCardPicker extends LitElement { )} >
@@ -352,8 +351,7 @@ export class HuiCardPicker extends LitElement { if (!value) { // Reset when we no longer filter this._width = undefined; - this._height = undefined; - } else if (!this._width || !this._height) { + } else if (!this._width) { // Save height and width so the dialog doesn't jump while searching const div = this.shadowRoot!.getElementById("content"); if (div && !this._width) { @@ -362,12 +360,6 @@ export class HuiCardPicker extends LitElement { this._width = width; } } - if (div && !this._height) { - const height = div.clientHeight; - if (height) { - this._height = height; - } - } } this._filter = value; @@ -450,11 +442,7 @@ export class HuiCardPicker extends LitElement { .config=${cardConfig} >
- ${customCard - ? `${this.hass!.localize( - "ui.panel.lovelace.editor.cardpicker.custom_card" - )}: ${customCard.name || customCard.type}` - : name} + ${customCard ? customCard.name || customCard.type : name}