Permalink
Browse files

Merge pull request #1710 from gseguin/issue-1338

Issue 1338
  • Loading branch information...
2 parents b3ad908 + 17000df commit e8a973f46a12da7906f64615b028cb7e28941784 Scott Jehl committed Jun 24, 2011
Showing with 38 additions and 2 deletions.
  1. +7 −0 tests/unit/select/index.html
  2. +29 −0 tests/unit/select/select_core.js
  3. +2 −2 themes/default/jquery.mobile.forms.select.css
@@ -239,6 +239,13 @@ <h2 id="qunit-userAgent"></h2>
<option value="overnight">Overnight</option>
</select>
</div>
+
+ <div data-nstest-role="fieldcontain" id="select-long-option-label-container">
+ <select name="select-long-option-label" id="select-long-option-label">
+ <option value="short">Choice 1</option>
+ <option value="long">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</option>
+ </select>
+ </div>
</div>
</body>
</html>
@@ -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);
@@ -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; }

0 comments on commit e8a973f

Please sign in to comment.