diff options
author | Kris Borchers <kris.borchers@gmail.com> | 2013-08-26 00:06:44 -0500 |
---|---|---|
committer | Kris Borchers <kris.borchers@gmail.com> | 2013-09-17 13:03:18 -0500 |
commit | 485e0a06121d712bccad82a21a9e443292d2f9bb (patch) | |
tree | fba89abdb0fc4bb39e00534fe12931e52228ee0a /tests | |
parent | d13df39e39010bb7cf2cec11b5206e85ea5fca2a (diff) | |
download | jquery-ui-485e0a06121d712bccad82a21a9e443292d2f9bb.tar.gz jquery-ui-485e0a06121d712bccad82a21a9e443292d2f9bb.zip |
Menu: Only focus menu after click if focus is on an element within menu. Fixes #9044 - Menu: Autofocus issue with dialog opened from menu widget
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/menu/menu_core.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/unit/menu/menu_core.js b/tests/unit/menu/menu_core.js index 5ee28c14a..923d2961e 100644 --- a/tests/unit/menu/menu_core.js +++ b/tests/unit/menu/menu_core.js @@ -27,4 +27,22 @@ test( "accessibility", function () { // Item roles are tested in the role option tests }); +asyncTest( "#9044: Autofocus issue with dialog opened from menu widget", function() { + expect( 1 ); + var element = $( "#menu1" ).menu(); + + $( "<input>", { id: "test9044" } ).appendTo( "body" ); + + $( "#testID1" ).bind( "click", function() { + $( "#test9044" ).focus(); + }); + + TestHelpers.menu.click( element, "3" ); + setTimeout( function() { + equal( document.activeElement.id, "test9044", "Focus was swallowed by menu" ); + $( "#test9044" ).remove(); + start(); + }); +}); + })( jQuery ); |