mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-09 02:49:51 +00:00
Fix clearing of filters (#20288)
* Fix clearing of filters * Update ha-filter-integrations.ts * Update ha-filter-integrations.ts
This commit is contained in:
@@ -59,7 +59,12 @@ export class HaFilterEntities extends LitElement {
|
||||
? html`
|
||||
<mwc-list class="ha-scrollbar">
|
||||
<lit-virtualizer
|
||||
.items=${this._entities(this.hass.states, this.type)}
|
||||
.items=${this._entities(
|
||||
this.hass.states,
|
||||
this.type,
|
||||
this.value
|
||||
)}
|
||||
.keyFunction=${this._keyFunction}
|
||||
.renderItem=${this._renderItem}
|
||||
@click=${this._handleItemClick}
|
||||
>
|
||||
@@ -81,6 +86,8 @@ export class HaFilterEntities extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
private _keyFunction = (entity) => entity?.entity_id;
|
||||
|
||||
private _renderItem = (entity) =>
|
||||
html`<ha-check-list-item
|
||||
.value=${entity.entity_id}
|
||||
@@ -119,7 +126,7 @@ export class HaFilterEntities extends LitElement {
|
||||
}
|
||||
|
||||
private _entities = memoizeOne(
|
||||
(states: HomeAssistant["states"], type: this["type"]) => {
|
||||
(states: HomeAssistant["states"], type: this["type"], _value) => {
|
||||
const values = Object.values(states);
|
||||
return values
|
||||
.filter(
|
||||
|
||||
Reference in New Issue
Block a user