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 /ui/jquery.ui.menu.js | |
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 'ui/jquery.ui.menu.js')
-rw-r--r-- | ui/jquery.ui.menu.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js index 3352eb8bd..272ab7bf4 100644 --- a/ui/jquery.ui.menu.js +++ b/ui/jquery.ui.menu.js @@ -85,7 +85,8 @@ $.widget( "ui.menu", { // Open submenu on click if ( target.has( ".ui-menu" ).length ) { this.expand( event ); - } else if ( !this.element.is( ":focus" ) ) { + } else if ( !this.element.is( ":focus" ) && $( this.document[ 0 ].activeElement ).closest( ".ui-menu" ).length ) { + // Redirect focus to the menu this.element.trigger( "focus", [ true ] ); |