diff --git a/js/selectlist.js b/js/selectlist.js
index 5ab50c487..26525de05 100644
--- a/js/selectlist.js
+++ b/js/selectlist.js
@@ -107,23 +107,23 @@
resize: function() {
var width = 0;
var newWidth = 0;
- var sizer = $('
').addClass('selectlist-sizer selectlist');
- var btnSizer = $('
').addClass('button-sizer selectlist');
+ var sizer = $('
').addClass('selectlist-sizer');
if( Boolean( $(document).find( 'html' ).hasClass( 'fuelux' ) ) ) {
// default behavior for fuel ux setup. means fuelux was a class on the html tag
- $( document.body ).append( sizer).append(btnSizer);
+ $( document.body ).append( sizer);
} else {
// fuelux is not a class on the html tag. So we'll look for the first one we find so the correct styles get applied to the sizer
- $( '.fuelux:first' ).append( sizer ).append(btnSizer);
+ $( '.fuelux:first' ).append( sizer );
}
sizer.append(this.$element.clone());
this.$element.find('a').each(function () {
sizer.find('.selected-label').text($(this).text());
- newWidth = sizer.outerWidth();
+ newWidth = sizer.find('.selectlist').outerWidth();
+ newWidth = newWidth + sizer.find('.sr-only').outerWidth();
if(newWidth > width) {
width = newWidth;
}
diff --git a/less/misc.less b/less/misc.less
index d8561a1b6..098cbb7e1 100644
--- a/less/misc.less
+++ b/less/misc.less
@@ -46,3 +46,18 @@ input, textarea {
position:absolute;
left:-9999px;
}
+
+.button-sizer, .selectlist-sizer {
+ display: inline-block;
+ position: absolute;
+ visibility: hidden;
+ top: 0;
+ float: left;
+ .dropdown-menu {
+ display: block;
+ min-width: inherit;
+ }
+ .selected-label {
+ width: auto !important;
+ }
+}
\ No newline at end of file
diff --git a/less/mixins.less b/less/mixins.less
index 9b52fd886..09b8f26a9 100644
--- a/less/mixins.less
+++ b/less/mixins.less
@@ -113,9 +113,8 @@
}
.vertical-align() {
- position: relative;
- top: 50%;
- -webkit-transform: translateY(-50%);
- -ms-transform: translateY(-50%);
- transform: translateY(-50%);
+ margin: auto;
+ position: absolute;
+ top: 0;
+ bottom: 0;
}
\ No newline at end of file
diff --git a/less/selectlist.less b/less/selectlist.less
index b8c3b5c97..2b8a583e8 100644
--- a/less/selectlist.less
+++ b/less/selectlist.less
@@ -16,12 +16,11 @@
white-space: normal;
.selected-label {
- padding-right: 10px;
+ padding-right: 18px;
float: left;
}
.caret {
.vertical-align();
- position: absolute;
right: @btnPaddingHorizontal;
}
}