From ca859e4e42c17a01d58215232132386e5ca8a413 Mon Sep 17 00:00:00 2001 From: Marc Schneider Date: Thu, 1 May 2014 15:35:32 +0200 Subject: [PATCH] Query term in tags function in select2 3.4 #2141 --- select2.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/select2.js b/select2.js index a8e2cf9f..4f7fc99e 100644 --- a/select2.js +++ b/select2.js @@ -538,9 +538,9 @@ the specific language governing permissions and limitations under the Apache Lic var isFunc = $.isFunction(data); return function (query) { var t = query.term, filtered = {results: []}; - var result = $(isFunc ? data(query) : data); + var result = isFunc ? data(query) : data; if ($.isArray(result)) { - $(isFunc ? data() : data).each(function () { + $(result).each(function () { var isObject = this.text !== undefined, text = isObject ? this.text : this; if (t === "" || query.matcher(t, text)) {