event = $.Event( "keydown" );
event.keyCode = $.ui.keyCode.DOWN;
element.trigger( event );
- equal( menu.find( ".ui-menu-item-wrapper.ui-state-focus" ).length, 1,
+ equal( menu.find( ".ui-menu-item-wrapper.ui-state-active" ).length, 1,
"menu item is active" );
event = $.Event( "keydown" );
open: function() {
equal(
element.autocomplete( "widget" )
- .find( ".ui-menu-item-wrapper.ui-state-focus" )
+ .find( ".ui-menu-item-wrapper.ui-state-active" )
.length,
focusedLength,
"first item is " + (afValue ? "" : "not") + " auto focused" );
expect( 1 );
var element = $( "#menu1" ).menu({
focus: function( event ) {
- log( $( event.target ).find( ".ui-state-focus" ).parent().index() );
+ log( $( event.target ).find( ".ui-menu-item-wrapper.ui-state-active" ).parent().index() );
}
});
log( $( ui.item[ 0 ] ).text() );
},
focus: function( event ) {
- log( $( event.target ).find( ".ui-state-focus" ).parent().index() );
+ log( $( event.target ).find( ".ui-menu-item-wrapper.ui-state-active" ).parent().index() );
}
});
log( $( ui.item[0] ).text() );
},
focus: function( event ) {
- log( $( event.target ).find( ".ui-state-focus" ).parent().index() );
+ log( $( event.target ).find( ".ui-menu-item-wrapper.ui-state-active:last" ).parent().index() );
}
});
log( $( ui.item[ 0 ] ).text() );
},
focus: function( event ) {
- log( $( event.target ).find( ".ui-state-focus" ).parent().index() );
+ log( $( event.target ).find( ".ui-menu-item-wrapper.ui-state-active:last" ).parent().index() );
}
});
log( $( ui.item[ 0 ] ).text() );
},
focus: function( event ) {
- log( $( event.target ).find( ".ui-state-focus" ).parent().index());
+ log( $( event.target ).find( ".ui-menu-item-wrapper.ui-state-active:last" ).parent().index());
}
});
log( $( ui.item[0] ).text() );
},
focus: function( event ) {
- log( $( event.target ).find( ".ui-state-focus" ).parent().index());
+ log( $( event.target ).find( ".ui-menu-item-wrapper.ui-state-active" ).parent().index());
}
});
log( $( ui.item[0] ).text() );
},
focus: function( event ) {
- log( $( event.target ).find( ".ui-state-focus" ).parent().index() );
+ log( $( event.target ).find( ".ui-menu-item-wrapper.ui-state-active" ).parent().index() );
}
});
expect( 3 );
var element = $( "#menu2" ).menu({
focus: function( event ) {
- log( $( event.target ).find( ".ui-state-focus" ).parent().index() );
+ log( $( event.target ).find( ".ui-menu-item-wrapper.ui-state-active" ).parent().index() );
}
});
expect( 1 );
var element = $( "#menu2" ).menu({
focus: function( event ) {
- log( $( event.target ).find( ".ui-state-focus" ).parent().index() );
+ log( $( event.target ).find( ".ui-menu-item-wrapper.ui-state-active" ).parent().index() );
}
});
});
function checkItemClasses() {
- focusedItem = menu.find( "li .ui-state-focus" );
+ focusedItem = menu.find( ".ui-menu-item-wrapper.ui-state-active" );
equal( focusedItem.length, 1, "only one item has ui-state-focus class" );
equal( focusedItem.attr( "id" ), wrappers.eq( element[ 0 ].selectedIndex ).attr( "id" ),
"selected item has ui-state-focus class" );
this._scrollIntoView( item );
this.active = item.first();
- focused = this.active.children( ".ui-menu-item-wrapper" )
- .addClass( "ui-state-focus" )
- .removeClass( "ui-state-active" );
+ focused = this.active.children( ".ui-menu-item-wrapper" ).addClass( "ui-state-active" );
// Only update aria-activedescendant if there's a role
// otherwise we assume focus is managed elsewhere
return;
}
- this.active.children( ".ui-menu-item-wrapper" ).removeClass( "ui-state-focus" );
+ this.active.children( ".ui-menu-item-wrapper" ).removeClass( "ui-state-active" );
this.active = null;
this._trigger( "blur", event, { item: this.active } );
.attr( "aria-hidden", "true" )
.attr( "aria-expanded", "false" )
.end()
- .find( ".ui-state-active" ).not( ".ui-state-focus" )
+ .find( ".ui-state-active" ).not( ".ui-menu-item-wrapper" )
.removeClass( "ui-state-active" );
},
} else {
// Menu clears focus on close, reset focus to selected item
- this.menu.find( ".ui-state-focus" ).removeClass( "ui-state-focus" );
+ this.menu.find( ".ui-state-active" ).removeClass( "ui-state-active" );
this.menuInstance.focus( null, this._getSelectedItem() );
}