From 2bf2661405e6f5cf32b6ba3f2bf62ce64248532c Mon Sep 17 00:00:00 2001 From: Daniel Lohse Date: Tue, 5 Dec 2017 18:12:36 +0100 Subject: [PATCH] Add option to disable filtering options by the search text If the filtering is done on the server-side or the search text isn't contained in the option text then this should be set to `false`. --- src/components/Select.vue | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/components/Select.vue b/src/components/Select.vue index c8f29b5..6e1603b 100644 --- a/src/components/Select.vue +++ b/src/components/Select.vue @@ -504,6 +504,16 @@ default: false }, + /** + * When true, existing options will be filtered + * by the search text. + * @type {Boolean} + */ + filterOptions: { + type: Boolean, + default: true + }, + /** * User defined function for adding Options * @type {Function} @@ -887,6 +897,9 @@ * @return {array} */ filteredOptions() { + if (this.filterOptions === false) { + return this.mutableOptions + } let options = this.mutableOptions.filter((option) => { if (typeof option === 'object' && option.hasOwnProperty(this.label)) { return option[this.label].toLowerCase().indexOf(this.search.toLowerCase()) > -1