Browse Source

realign dropdown when search box moves to new line. closes #43

Igor Vaynberg 13 năm trước cách đây
mục cha
commit
095cdda05e
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      select2.js

+ 3 - 1
select2.js

@@ -1237,7 +1237,6 @@
             this.addSelectedChoice(data);
             this.addSelectedChoice(data);
             if (this.select) { this.postprocessResults(); }
             if (this.select) { this.postprocessResults(); }
 
 
-
             if (this.opts.closeOnSelect) {
             if (this.opts.closeOnSelect) {
                 this.close();
                 this.close();
                 this.search.width(10);
                 this.search.width(10);
@@ -1356,6 +1355,9 @@
                 searchWidth = maxWidth - getSideBorderPadding(this.search);
                 searchWidth = maxWidth - getSideBorderPadding(this.search);
             }
             }
             this.search.width(searchWidth);
             this.search.width(searchWidth);
+
+            // in case the search box was pushed to the next line realign the dropdown
+            if (this.opened()) { this.alignDropdown(); }
         },
         },
 
 
         getVal: function () {
         getVal: function () {