From 6c59b1e99c4a2c11d531ed6975c9c5da605682ab Mon Sep 17 00:00:00 2001 From: Brendan Heywood Date: Thu, 1 Nov 2012 18:00:38 +1000 Subject: [PATCH] Only select the first suitable item if nothing is already selected --- select2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/select2.js b/select2.js index 0cc6aeaa..ac1e6e79 100644 --- a/select2.js +++ b/select2.js @@ -2166,7 +2166,7 @@ the specific language governing permissions and limitations under the Apache Lic } }); - if (this.opts.closeOnSelect){ + if (this.highlight() == -1){ choices.each2(function (i, choice) { if (!choice.hasClass("select2-disabled") && choice.hasClass("select2-result-selectable")) { self.highlight(0);