瀏覽代碼

do not open when clicked on a search choice. fixes #336

Igor Vaynberg 12 年之前
父節點
當前提交
7b60524b35
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      select2.js

+ 4 - 0
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();