Browse Source

take the outerwidth of the element when sizing so we include padding and border. fixes #213

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

+ 1 - 1
select2.js

@@ -1070,7 +1070,7 @@
             if (style.indexOf("%") > 0) return style;
 
             // finally, fallback on the calculated width of the element
-            return (this.opts.element.width() === 0 ? 'auto' : this.opts.element.width() + 'px');
+            return (this.opts.element.width() === 0 ? 'auto' : this.opts.element.outerWidth() + 'px');
         }
     });