mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 03:36:44 +00:00
Entity Picker: undo fuzzy algorithm (#7360)
This commit is contained in:
parent
7251e802ab
commit
c268f42851
@ -20,7 +20,6 @@ import memoizeOne from "memoize-one";
|
|||||||
import { fireEvent } from "../../common/dom/fire_event";
|
import { fireEvent } from "../../common/dom/fire_event";
|
||||||
import { computeDomain } from "../../common/entity/compute_domain";
|
import { computeDomain } from "../../common/entity/compute_domain";
|
||||||
import { computeStateName } from "../../common/entity/compute_state_name";
|
import { computeStateName } from "../../common/entity/compute_state_name";
|
||||||
import { fuzzySequentialMatch } from "../../common/string/sequence_matching";
|
|
||||||
import { PolymerChangedEvent } from "../../polymer-types";
|
import { PolymerChangedEvent } from "../../polymer-types";
|
||||||
import { HomeAssistant } from "../../types";
|
import { HomeAssistant } from "../../types";
|
||||||
import "../ha-svg-icon";
|
import "../ha-svg-icon";
|
||||||
@ -266,12 +265,12 @@ export class HaEntityPicker extends LitElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private _filterChanged(ev): void {
|
private _filterChanged(ev: CustomEvent): void {
|
||||||
(this._comboBox as any).filteredItems = this._states.filter((state) =>
|
const filterString = ev.detail.value.toLowerCase();
|
||||||
fuzzySequentialMatch(ev.detail.value, [
|
(this._comboBox as any).filteredItems = this._states.filter(
|
||||||
state.entity_id,
|
(state) =>
|
||||||
computeStateName(state),
|
state.entity_id.toLowerCase().includes(filterString) ||
|
||||||
])
|
computeStateName(state).toLowerCase().includes(filterString)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user