mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Menu tests: Check default is prevented on any click on disabled menus
(cherry picked from commit a74ac174cc
)
This commit is contained in:
parent
152c190001
commit
be7d0a54ea
@ -598,4 +598,25 @@ asyncTest( "handle keyboard navigation with spelling of menu items", function()
|
||||
element[0].focus();
|
||||
});
|
||||
|
||||
test( "ensure default is prevented when clicking on anchors in disabled menus ", function() {
|
||||
expect( 1 );
|
||||
var element = $( "#menu1" ).menu();
|
||||
element.bind("click.menu", function(event) {
|
||||
if ( !event.isDefaultPrevented() ) {
|
||||
log();
|
||||
}
|
||||
});
|
||||
log( "click", true );
|
||||
click( $( "#menu1" ), "1" );
|
||||
log( "afterclick,disable" );
|
||||
element.menu("option", "disabled", true);
|
||||
click( element, "2" );
|
||||
click( $( "#menu1" ), "3" );
|
||||
click( element, "1" );
|
||||
log( "enable" );
|
||||
element.menu("option", "disabled", false);
|
||||
click( element, "3" );
|
||||
equal( logOutput(), "click,1,afterclick,disable,enable,3", "Click order not valid." );
|
||||
});
|
||||
|
||||
})( jQuery );
|
||||
|
Loading…
Reference in New Issue
Block a user