Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tests/unit/menu/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,9 @@ QUnit.test( "handle keyboard navigation and mouse click on menu with dividers an
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
assert.equal( logOutput(), "keydown,3,4,7", "Keydown focus skips divider and group label" );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
assert.equal( logOutput(), "keydown,1,2,3,4,7", "Keydown focus skips divider and group label" );
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test changed because an item is selected in the step before this, causing the menu to close. This test only passed before because of the short delay; had it waited for the menu to fully react, the test would have failed.

ready();
}
} );
Expand Down
4 changes: 2 additions & 2 deletions ui/widgets/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ return $.widget( "ui.menu", {
this._on( this.document, {
click: function( event ) {
if ( this._closeOnDocumentClick( event ) ) {
this.collapseAll( event );
this.collapseAll( event, true );
}

// Reset the mouseHandled flag
Expand Down Expand Up @@ -502,7 +502,7 @@ return $.widget( "ui.menu", {
this._removeClass( currentMenu.find( ".ui-state-active" ), null, "ui-state-active" );

this.activeMenu = currentMenu;
}, this.delay );
}, all ? 0 : this.delay );
},

// With no arguments, closes the currently active menu - if nothing is active
Expand Down