diff --git a/js/selectlist.js b/js/selectlist.js index 8240286f8..e24e58d51 100644 --- a/js/selectlist.js +++ b/js/selectlist.js @@ -104,7 +104,7 @@ resize: function () { var width = 0; var newWidth = 0; - var sizer = $('
').addClass('selectlist-sizer'); + var sizer = $('').addClass('dummy-selectlist'); if (Boolean($(document).find('html').hasClass('fuelux'))) { @@ -126,6 +126,10 @@ } }); + if (width <= 1) { + return; + } + this.$button.css('width', width); this.$dropdownMenu.css('width', width); diff --git a/less/misc.less b/less/misc.less index 098cbb7e1..6a1da646f 100644 --- a/less/misc.less +++ b/less/misc.less @@ -47,12 +47,15 @@ input, textarea { left:-9999px; } -.button-sizer, .selectlist-sizer { +.button-sizer, .dummy-selectlist { display: inline-block; position: absolute; visibility: hidden; top: 0; float: left; + .selectlist { + display: block !important; + } .dropdown-menu { display: block; min-width: inherit; diff --git a/test/markup/selectlist-markup.html b/test/markup/selectlist-markup.html index 26246eacb..51ecb9b4e 100644 --- a/test/markup/selectlist-markup.html +++ b/test/markup/selectlist-markup.html @@ -93,3 +93,72 @@ + +