From 5f6baa48b130dc6bb744fe77e85ba1366ee69214 Mon Sep 17 00:00:00 2001 From: Michele Girini Date: Sat, 7 Mar 2020 13:23:21 +0100 Subject: [PATCH] option to disable regex items matching Disable the regex items matching if minMatchingChar === 0. Useful when using with external services (like a geocoder) where all results are already filtered based on the search query. --- src/components/VueBootstrapTypeaheadList.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/VueBootstrapTypeaheadList.vue b/src/components/VueBootstrapTypeaheadList.vue index f404987..96f9a25 100644 --- a/src/components/VueBootstrapTypeaheadList.vue +++ b/src/components/VueBootstrapTypeaheadList.vue @@ -77,6 +77,9 @@ export default { }, matchedItems() { + + if (this.minMatchingChars === 0) return this.data + if (this.query.length === 0 || this.query.length < this.minMatchingChars) { return [] }