Fix card-picker search for single character (#18733)

* Fix card-picker search for single character

* Update src/panels/lovelace/editor/card-editor/hui-card-picker.ts

Co-authored-by: Paul Bottein <paul.bottein@gmail.com>

---------

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
Co-authored-by: Paul Bottein <paul.bottein@gmail.com>
This commit is contained in:
karwosts 2023-11-24 06:23:27 -08:00 committed by GitHub
parent 1de2e6161d
commit 239d8fa948
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,7 +81,7 @@ export class HuiCardPicker extends LitElement {
const options: IFuseOptions<Card> = {
keys: ["type", "name", "description"],
isCaseSensitive: false,
minMatchCharLength: 2,
minMatchCharLength: filter.length === 1 ? 1 : 2,
threshold: 0.2,
};
const fuse = new Fuse(cards, options);