diff --git a/hassio/src/components/hassio-filter-addons.ts b/hassio/src/components/hassio-filter-addons.ts index e9dd591918..76635c62dc 100644 --- a/hassio/src/components/hassio-filter-addons.ts +++ b/hassio/src/components/hassio-filter-addons.ts @@ -6,7 +6,7 @@ export function filterAndSort(addons: StoreAddon[], filter: string) { const options: IFuseOptions = { keys: ["name", "description", "slug"], isCaseSensitive: false, - minMatchCharLength: 2, + minMatchCharLength: Math.min(filter.length, 2), threshold: 0.2, }; const fuse = new Fuse(addons, options); diff --git a/src/panels/config/integrations/dialog-add-integration.ts b/src/panels/config/integrations/dialog-add-integration.ts index 2e2a3f100e..bd60e664ab 100644 --- a/src/panels/config/integrations/dialog-add-integration.ts +++ b/src/panels/config/integrations/dialog-add-integration.ts @@ -249,7 +249,7 @@ class AddIntegrationDialog extends LitElement { "iot_standards", ], isCaseSensitive: false, - minMatchCharLength: 2, + minMatchCharLength: Math.min(filter.length, 2), threshold: 0.2, }; const helpers = Object.entries(h).map(([domain, integration]) => ({ diff --git a/src/panels/config/integrations/ha-config-integrations-dashboard.ts b/src/panels/config/integrations/ha-config-integrations-dashboard.ts index 5483b3f3fc..ed2b52ce04 100644 --- a/src/panels/config/integrations/ha-config-integrations-dashboard.ts +++ b/src/panels/config/integrations/ha-config-integrations-dashboard.ts @@ -161,7 +161,7 @@ class HaConfigIntegrationsDashboard extends SubscribeMixin(LitElement) { const options: IFuseOptions = { keys: ["domain", "localized_domain_name", "title"], isCaseSensitive: false, - minMatchCharLength: 2, + minMatchCharLength: Math.min(filter.length, 2), threshold: 0.2, }; const fuse = new Fuse(configEntries, options); @@ -205,7 +205,7 @@ class HaConfigIntegrationsDashboard extends SubscribeMixin(LitElement) { const options: IFuseOptions = { keys: ["handler", "localized_title"], isCaseSensitive: false, - minMatchCharLength: 2, + minMatchCharLength: Math.min(filter.length, 2), threshold: 0.2, }; const fuse = new Fuse(configEntriesInProgress, options); diff --git a/src/panels/lovelace/editor/card-editor/hui-card-picker.ts b/src/panels/lovelace/editor/card-editor/hui-card-picker.ts index f9773c8c1b..5386422c6a 100644 --- a/src/panels/lovelace/editor/card-editor/hui-card-picker.ts +++ b/src/panels/lovelace/editor/card-editor/hui-card-picker.ts @@ -81,7 +81,7 @@ export class HuiCardPicker extends LitElement { const options: IFuseOptions = { keys: ["type", "name", "description"], isCaseSensitive: false, - minMatchCharLength: filter.length === 1 ? 1 : 2, + minMatchCharLength: Math.min(filter.length, 2), threshold: 0.2, }; const fuse = new Fuse(cards, options);