From 7b60524b350fd0678f5e59c17ec7808be0516743 Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Thu, 16 Aug 2012 22:24:58 -0700 Subject: [PATCH] do not open when clicked on a search choice. fixes #336 --- select2.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/select2.js b/select2.js index bd86cbcb..6e8d2df4 100755 --- a/select2.js +++ b/select2.js @@ -1857,6 +1857,10 @@ this.container.delegate(selector, "mousedown", this.bind(function (e) { if (!this.enabled) return; + if ($(e.target).closest(".select2-search-choice").length > 0) { + // clicked inside a select2 search choice, do not open + return; + } this.clearPlaceholder(); this.open(); this.focusSearch();