aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2016-03-11 17:35:25 +0100
committerJörn Zaefferer <joern.zaefferer@gmail.com>2016-03-11 18:27:58 +0100
commit4866e14922217560f551b86ce80952c3e0f649da (patch)
tree56ec31670d0ac6b9bd0ca7a7ce263eaa0d73db1a /ui
parent54cd4510ef955a5f50a4fc5aa91ccb85217e6a04 (diff)
downloadjquery-ui-4866e14922217560f551b86ce80952c3e0f649da.tar.gz
jquery-ui-4866e14922217560f551b86ce80952c3e0f649da.zip
Menu: Remove active class from top-level item when menu is blurred
This issue was introduced by 0bbd1569182bc03e8dc4f5f8aa203e8edbe15f99, which reduced the use of ui-state-focus and ui-state-active to using only ui-state-focus. This introduced the issue addressed here. The fix is more of a workaround. With test test in place, we can investigate a better solution in the future. Fixes #14919
Diffstat (limited to 'ui')
-rw-r--r--ui/widgets/menu.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/ui/widgets/menu.js b/ui/widgets/menu.js
index e7b13e7c9..c5627cc20 100644
--- a/ui/widgets/menu.js
+++ b/ui/widgets/menu.js
@@ -487,6 +487,10 @@ return $.widget( "ui.menu", {
this._close( currentMenu );
this.blur( event );
+
+ // Work around active item staying active after menu is blurred
+ this._removeClass( currentMenu.find( ".ui-state-active" ), null, "ui-state-active" );
+
this.activeMenu = currentMenu;
}, this.delay );
},
@@ -498,14 +502,10 @@ return $.widget( "ui.menu", {
startMenu = this.active ? this.active.parent() : this.element;
}
- var active = startMenu
- .find( ".ui-menu" )
- .hide()
- .attr( "aria-hidden", "true" )
- .attr( "aria-expanded", "false" )
- .end()
- .find( ".ui-state-active" ).not( ".ui-menu-item-wrapper" );
- this._removeClass( active, null, "ui-state-active" );
+ startMenu.find( ".ui-menu" )
+ .hide()
+ .attr( "aria-hidden", "true" )
+ .attr( "aria-expanded", "false" );
},
_closeOnDocumentClick: function( event ) {