menu = element.selectmenu( "menuWidget" );
button.simulate( "focus" );
- links = menu.find( "li.ui-menu-item a" );
+ links = menu.find( "li.ui-menu-item" );
expect( 12 + links.length * 2 );
button.simulate( "focus" );
setTimeout(function() {
- links = menu.find("li.ui-menu-item a");
+ links = menu.find("li.ui-menu-item");
button.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
equal(
button.simulate( "focus" );
setTimeout(function() {
- links = menu.find("li.ui-menu-item a");
+ links = menu.find("li.ui-menu-item");
button.trigger( "click" );
- menu.find( "a" ).last().simulate( "mouseover" ).trigger( "click" );
+ menu.find( "li" ).last().simulate( "mouseover" ).trigger( "click" );
equal(
menu.attr( "aria-activedescendant" ),
links.eq( element[ 0 ].selectedIndex ).attr( "id" ),
button.simulate( "focus" );
setTimeout(function() {
- links = menu.find( "li.ui-menu-item a" );
+ links = menu.find( "li.ui-menu-item" );
// open menu and click first item
button.trigger( "click" );
links.first().simulate( "mouseover" ).trigger( "click" );
button.simulate( "focus" );
setTimeout(function() {
- links = menu.find( "li.ui-menu-item a" );
+ links = menu.find( "li.ui-menu-item" );
button.trigger( "click" );
links.first().simulate( "mouseover" ).trigger( "click" );
button.simulate( "focus" );
setTimeout(function() {
- links = menu.find( "li.ui-menu-item a" );
+ links = menu.find( "li.ui-menu-item" );
button.trigger( "click" );
setTimeout(function() {
}, 1 );
function checkItemClasses() {
- focusedItem = menu.find( "li.ui-menu-item a.ui-state-focus" );
+ focusedItem = menu.find( "li.ui-state-focus" );
equal( focusedItem.length, 1, "only one item has ui-state-focus class" );
equal( focusedItem.attr( "id" ), links.eq( element[ 0 ].selectedIndex ).attr( "id" ), "selected item has ui-state-focus class" );
- activeItem = menu.find( "li.ui-menu-item a.ui-state-active" );
+ activeItem = menu.find( "li.ui-state-active" );
equal( activeItem.length, 1, "only one item has ui-state-active class" );
equal( activeItem.attr( "id" ), links.eq( element[ 0 ].selectedIndex ).attr( "id" ), "selected item has ui-state-active class" );
}
setTimeout(function() {
button.trigger( "click" );
- menu.find( "a" ).eq( optionIndex ).simulate( "mouseover" ).trigger( "click" );
+ menu.find( "li" ).eq( optionIndex ).simulate( "mouseover" ).trigger( "click" );
start();
}, 1 );
});
button.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
button.trigger( "click" );
- links = menu.find( "li.ui-menu-item a" );
+ links = menu.find( "li.ui-menu-item" );
optionIndex = 0;
links.eq( optionIndex ).simulate( "mouseover" );
optionIndex += 1;
setTimeout(function() {
button.trigger( "click" );
- menu.find( "a" ).eq( optionIndex ).simulate( "mouseover" ).trigger( "click" );
+ menu.find( "li" ).eq( optionIndex ).simulate( "mouseover" ).trigger( "click" );
start();
}, 1 );
});
this._renderMenu( this.menu, this.items );
this.menuInstance.refresh();
- this.menuItems = this.menu.find( "li" ).not( ".ui-selectmenu-optgroup" ).find( "a" );
+ this.menuItems = this.menu.find( "li" ).not( ".ui-selectmenu-optgroup" );
item = this._getSelectedItem();
$.each( items, function( index, item ) {
if ( item.optgroup !== currentOptgroup ) {
$( "<li>", {
- "class": "ui-selectmenu-optgroup" +
+ "class": "ui-selectmenu-optgroup ui-menu-divider" +
( item.element.parent( "optgroup" ).attr( "disabled" ) ?
" ui-state-disabled" :
"" ),
},
_renderItem: function( ul, item ) {
- var li = $( "<li>" ),
- a = $( "<a>", { href: "#" });
+ var li = $( "<li>" );
if ( item.disabled ) {
li.addClass( "ui-state-disabled" );
}
- this._setText( a, item.label );
+ this._setText( li, item.label );
- return li.append( a ).appendTo( ul );
+ return li.appendTo( ul );
},
_setText: function( element, value ) {
},
_getSelectedItem: function() {
- return this.menuItems.eq( this.element[ 0 ].selectedIndex ).parent( "li" );
+ return this.menuItems.eq( this.element[ 0 ].selectedIndex );
},
_toggle: function( event ) {
},
_setAria: function( item ) {
- var link = this.menuItems.eq( item.index ),
- id = link.attr( "id" );
+ var id = this.menuItems.eq( item.index ).attr( "id" );
this.button.attr({
"aria-labelledby": id,