Permalink
Browse files

Selectmenu: Prepend icon and move overflow to text span

Fixes #14938
Closes gh-1685
  • Loading branch information...
arschmitz authored and scottgonzalez committed Mar 30, 2016
1 parent bf5d6f3 commit bff8277fbc885bf2dc0461ac706d2f2bb7035ad6
Showing with 9 additions and 6 deletions.
  1. +1 −1 tests/unit/selectmenu/core.js
  2. +6 −2 themes/base/selectmenu.css
  3. +2 −3 ui/widgets/selectmenu.js
@@ -21,7 +21,7 @@ test( "markup structure", function( assert ) {
assert.lacksClasses( button, "ui-selectmenu-button-open ui-selectmenu-open" );
assert.hasClasses( menuWrap, "ui-selectmenu-menu" );
assert.lacksClasses( menuWrap, "ui-selectmenu-menu-open" );
assert.strictEqual( icon[ 0 ], button.children().last()[ 0 ], "Icon is last child of button" );
assert.strictEqual( icon[ 0 ], button.children()[ 0 ], "Icon is first child of button" );
} );
asyncTest( "accessibility", function() {
@@ -33,10 +33,14 @@
.ui-selectmenu-open {
display: block;
}
.ui-selectmenu-button.ui-button {
text-align: left;
.ui-selectmenu-text {
display: block;
margin-right: 20px;
overflow: hidden;
text-overflow: ellipsis;
}
.ui-selectmenu-button.ui-button {
text-align: left;
white-space: nowrap;
width: 14em;
}
View
@@ -119,11 +119,10 @@ return $.widget( "ui.selectmenu", [ $.ui.formResetMixin, {
this._addClass( this.button, "ui-selectmenu-button ui-selectmenu-button-closed",
"ui-button ui-widget" );
this.buttonItem = this._renderButtonItem( item )
.appendTo( this.button );
icon = $( "<span>" ).appendTo( this.button );
this._addClass( icon, "ui-selectmenu-icon", "ui-icon " + this.options.icons.button );
this.buttonItem = this._renderButtonItem( item )
.appendTo( this.button );
if ( this.options.width !== false ) {
this._resizeButton();

0 comments on commit bff8277

Please sign in to comment.