From 3be19d8e62fd4963dff0df485851a61df41ef161 Mon Sep 17 00:00:00 2001 From: Tom Zellman Date: Tue, 25 Aug 2015 21:33:04 -0400 Subject: [PATCH] Fix broken tags, #3695 The local variable defined will overwrite the tags function, since the var will get hoisted to the functional scope --- select2.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/select2.js b/select2.js index f08e4dc1..62304456 100644 --- a/select2.js +++ b/select2.js @@ -1023,14 +1023,14 @@ the specific language governing permissions and limitations under the Apache Lic // data-select2-tags -> data-tags if (opts.element.data('tags') != null) { - var tags = opts.element.data('tags'); + var elemTags = opts.element.data('tags'); // data-tags should actually be a boolean - if (!$.isArray(tags)) { - tags = []; + if (!$.isArray(elemTags)) { + elemTags = []; } - opts.element.data('select2Tags', tags); + opts.element.data('select2Tags', elemTags); } // sortResults -> sorter