diff options
author | TJ VanToll <tj.vantoll@gmail.com> | 2013-08-02 06:51:04 -0400 |
---|---|---|
committer | TJ VanToll <tj.vantoll@gmail.com> | 2013-08-03 17:43:30 -0400 |
commit | 484e382259f1c1c56b151a97ddf8a894f94d17ea (patch) | |
tree | 298d068f09a8a239ed2d2a092a11ad6165970263 /ui | |
parent | a3770884ac997169b810b3f6fda6df54a9cbbeeb (diff) | |
download | jquery-ui-484e382259f1c1c56b151a97ddf8a894f94d17ea.tar.gz jquery-ui-484e382259f1c1c56b151a97ddf8a894f94d17ea.zip |
Menu: Only set the mouseHandled flag if the event is going to bubble. Fixes #9469: on( "menuselect" )
not firing every time.
Diffstat (limited to 'ui')
-rw-r--r-- | ui/jquery.ui.menu.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js index c0222629d..b4f0d48c1 100644 --- a/ui/jquery.ui.menu.js +++ b/ui/jquery.ui.menu.js @@ -75,9 +75,13 @@ $.widget( "ui.menu", { "click .ui-menu-item:has(a)": function( event ) { var target = $( event.target ).closest( ".ui-menu-item" ); if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) { - this.mouseHandled = true; - this.select( event ); + + // Only set the mouseHandled flag if the event will bubble, see #9469. + if ( !event.isPropagationStopped() ) { + this.mouseHandled = true; + } + // Open submenu on click if ( target.has( ".ui-menu" ).length ) { this.expand( event ); |