diff --git a/src/components/entity/ha-entities-picker.ts b/src/components/entity/ha-entities-picker.ts index 16e51de099..f544cffbf1 100644 --- a/src/components/entity/ha-entities-picker.ts +++ b/src/components/entity/ha-entities-picker.ts @@ -1,9 +1,11 @@ +import { mdiDrag } from "@mdi/js"; import { css, html, LitElement, nothing } from "lit"; import { customElement, property } from "lit/decorators"; import memoizeOne from "memoize-one"; import { fireEvent } from "../../common/dom/fire_event"; import { isValidEntityId } from "../../common/entity/valid_entity_id"; import type { HomeAssistant, ValueChangedEvent } from "../../types"; +import "../ha-sortable"; import "./ha-entity-picker"; import type { HaEntityPickerEntityFilterFunc } from "./ha-entity-picker"; @@ -76,6 +78,9 @@ class HaEntitiesPicker extends LitElement { @property({ attribute: false, type: Array }) public createDomains?: string[]; + @property({ type: Boolean }) + public reorder = false; + protected render() { if (!this.hass) { return nothing; @@ -84,28 +89,44 @@ class HaEntitiesPicker extends LitElement { const currentEntities = this._currentEntities; return html` ${this.label ? html`` : nothing} - ${currentEntities.map( - (entityId) => html` -