Skip to content

Commit 6326da3

Browse files
committed
Menu: Add ui-state-active to parent item when submenu item receives focus.
1 parent 4955699 commit 6326da3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ui/jquery.ui.menu.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ $.widget("ui.menu", {
229229
// need to remove the attribute before adding it for the screenreader to pick up the change
230230
// see http://groups.google.com/group/jquery-a11y/msg/929e0c1e8c5efc8f
231231
this.element.removeAttr("aria-activedescendant").attr("aria-activedescendant", self.itemId)
232+
233+
// highlight active parent menu item, if any
234+
this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active");
232235

233236
self.timer = setTimeout(function() {
234237
self._close();
@@ -277,8 +280,6 @@ $.widget("ui.menu", {
277280
);
278281

279282
submenu.show().position(position);
280-
281-
this.active.find(">a:first").addClass("ui-state-active");
282283
},
283284

284285
closeAll: function() {

0 commit comments

Comments
 (0)