瀏覽代碼

Merge pull request #2789 from RustyToms/drop_above_dropHeight_fix

recalculate $dropdown height after drop-above class added
Kevin Brown 10 年之前
父節點
當前提交
a8377e3681
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      select2.js

+ 3 - 2
select2.js

@@ -1325,10 +1325,11 @@ the specific language governing permissions and limitations under the Apache Lic
             };
 
             if (above) {
-                css.top = offset.top - dropHeight;
-                css.bottom = 'auto';
                 this.container.addClass("select2-drop-above");
                 $dropdown.addClass("select2-drop-above");
+                dropHeight = $dropdown.outerHeight(false);
+                css.top = offset.top - dropHeight;
+                css.bottom = 'auto';
             }
             else {
                 css.top = dropTop;