浏览代码

always detach and append the dropdown on open. this ensures it will be the last element in body and thus have the highest z-index. issue #105. issue #84

Igor Vaynberg 13 年之前
父节点
当前提交
a6eeadbe7a
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      select2.js

+ 1 - 2
select2.js

@@ -389,7 +389,6 @@
 
             this.results = results = this.container.find(resultsSelector);
             this.search = search = this.container.find("input[type=text]");
-            this.dropdown.detach().appendTo('body');
 
             this.resultsPage = 0;
             this.context = null;
@@ -695,7 +694,7 @@
             if (this.opened()) return;
 
             this.container.addClass("select2-dropdown-open").addClass("select2-container-active");
-            this.dropdown.addClass("select2-drop-active");
+            this.dropdown.detach().appendTo('body').addClass("select2-drop-active");
 
             this.updatePositions();