Use list item for entity picker (#25176)

Co-authored-by: Wendelin <12148533+wendevlin@users.noreply.github.com>
Co-authored-by: Wendelin <w@pe8.at>
This commit is contained in:
Paul Bottein
2025-04-29 13:30:32 +02:00
committed by GitHub
parent 536602580d
commit f9fbb254bf
13 changed files with 823 additions and 458 deletions

View File

@@ -39,8 +39,8 @@ import { SubscribeMixin } from "../mixins/subscribe-mixin";
import type { HomeAssistant } from "../types";
import "./device/ha-device-picker";
import type { HaDevicePickerDeviceFilterFunc } from "./device/ha-device-picker";
import "./entity/ha-entity-picker";
import type { HaEntityPickerEntityFilterFunc } from "./entity/ha-entity-picker";
import "./entity/ha-entity-combo-box";
import type { HaEntityComboBoxEntityFilterFunc } from "./entity/ha-entity-combo-box";
import "./ha-area-floor-picker";
import { floorDefaultIconPath } from "./ha-floor-icon";
import "./ha-icon-button";
@@ -80,7 +80,7 @@ export class HaTargetPicker extends SubscribeMixin(LitElement) {
public deviceFilter?: HaDevicePickerDeviceFilterFunc;
@property({ attribute: false })
public entityFilter?: HaEntityPickerEntityFilterFunc;
public entityFilter?: HaEntityComboBoxEntityFilterFunc;
@property({ type: Boolean, reflect: true }) public disabled = false;
@@ -449,7 +449,7 @@ export class HaTargetPicker extends SubscribeMixin(LitElement) {
></ha-label-picker>
`
: html`
<ha-entity-picker
<ha-entity-combo-box
.hass=${this.hass}
id="input"
.type=${"entity_id"}
@@ -464,7 +464,7 @@ export class HaTargetPicker extends SubscribeMixin(LitElement) {
@value-changed=${this._targetPicked}
@click=${this._preventDefault}
allow-custom-entity
></ha-entity-picker>
></ha-entity-combo-box>
`}</mwc-menu-surface
>`;
}
@@ -839,7 +839,7 @@ export class HaTargetPicker extends SubscribeMixin(LitElement) {
mwc-menu-surface {
--mdc-menu-min-width: 100%;
}
ha-entity-picker,
ha-entity-combo-box,
ha-device-picker,
ha-area-floor-picker {
display: block;