From 40843b1b98740bc0d08fd0d083517cc1915c72ff Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Fri, 30 Mar 2012 21:25:38 -0700 Subject: [PATCH] better handling of non-numeric ids --- select2.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/select2.js b/select2.js index 9e2d15f8..b957cc0b 100755 --- a/select2.js +++ b/select2.js @@ -764,7 +764,7 @@ // find the selected element in the result list this.results.find(".select2-result").each(function (i) { - if ($(this).data("select2-data").id === self.opts.element.val()) { + if (equal($(this).data("select2-data").id, self.opts.element.val())) { selected = i; return false; } @@ -1062,7 +1062,7 @@ choices.each(function () { var choice = $(this), id = choice.data("select2-data").id; - if (val.indexOf(id) >= 0) { + if (indexOf(id, val) >= 0) { choice.addClass("select2-disabled"); } else { choice.removeClass("select2-disabled");