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:
@@ -57,7 +57,8 @@ export class HaFilterDevices extends LitElement {
|
||||
${this._shouldRender
|
||||
? html`<mwc-list class="ha-scrollbar">
|
||||
<lit-virtualizer
|
||||
.items=${this._devices(this.hass.devices)}
|
||||
.items=${this._devices(this.hass.devices, this.value)}
|
||||
.keyFunction=${this._keyFunction}
|
||||
.renderItem=${this._renderItem}
|
||||
@click=${this._handleItemClick}
|
||||
>
|
||||
@@ -68,6 +69,8 @@ export class HaFilterDevices extends LitElement {
|
||||
`;
|
||||
}
|
||||
|
||||
private _keyFunction = (device) => device?.id;
|
||||
|
||||
private _renderItem = (device) =>
|
||||
html`<ha-check-list-item
|
||||
.value=${device.id}
|
||||
@@ -109,7 +112,7 @@ export class HaFilterDevices extends LitElement {
|
||||
this.expanded = ev.detail.expanded;
|
||||
}
|
||||
|
||||
private _devices = memoizeOne((devices: HomeAssistant["devices"]) => {
|
||||
private _devices = memoizeOne((devices: HomeAssistant["devices"], _value) => {
|
||||
const values = Object.values(devices);
|
||||
return values.sort((a, b) =>
|
||||
stringCompare(
|
||||
|
||||
Reference in New Issue
Block a user