diff --git a/tests/unit/select/index.html b/tests/unit/select/index.html index 7e21c235..0c9da49f 100644 --- a/tests/unit/select/index.html +++ b/tests/unit/select/index.html @@ -239,6 +239,13 @@ + +
+ +
diff --git a/tests/unit/select/select_core.js b/tests/unit/select/select_core.js index cc9d02c4..c750f95b 100644 --- a/tests/unit/select/select_core.js +++ b/tests/unit/select/select_core.js @@ -95,4 +95,33 @@ $.testHelper.sequence(sequence, 1000); }); + module("Non native menus", { + setup: function() { + $.mobile.selectmenu.prototype.options.nativeMenu = false; + }, + teardown: function() { + $.mobile.selectmenu.prototype.options.nativeMenu = true; + } + }); + + asyncTest( "a large select option should not overflow", function(){ + // https://github.com/jquery/jquery-mobile/issues/1338 + var menu, select = $("#select-long-option-label"); + + $.testHelper.sequence([ + function(){ + // bring up the dialog + select.trigger("click"); + }, + + function() { + menu = $(".ui-selectmenu-list"); + + equal(menu.width(), menu.find("li:nth-child(2) .ui-btn-text").width(), "ui-btn-text element should not overflow") + start(); + } + ], 500); + + }); + })(jQuery); diff --git a/themes/default/jquery.mobile.forms.select.css b/themes/default/jquery.mobile.forms.select.css index 1b6e4dfa..3ec7c210 100644 --- a/themes/default/jquery.mobile.forms.select.css +++ b/themes/default/jquery.mobile.forms.select.css @@ -17,8 +17,8 @@ label.ui-select { font-size: 16px; line-height: 1.4; font-weight: normal; margin: 0 0 .3em; display: block; } /*listbox*/ -.ui-select .ui-btn-text, .ui-selectmenu .ui-btn-text { display: inline-block; min-height: 1em; } -.ui-select .ui-btn-text { text-overflow: ellipsis; overflow: hidden; display: block;} +.ui-select .ui-btn-text, .ui-selectmenu .ui-btn-text { display: block; min-height: 1em; } +.ui-select .ui-btn-text { text-overflow: ellipsis; overflow: hidden;} .ui-selectmenu { position: absolute; padding: 0; z-index: 100 !important; width: 80%; max-width: 350px; padding: 6px; } .ui-selectmenu .ui-listview { margin: 0; }