Skip to content
Permalink
Browse files

Menu: Make keyboard focus matching take submenus into account

  • Loading branch information
jzaefferer committed Apr 20, 2011
1 parent 5076f23 commit f0d5a0008f193c1ebabd808ff0a9f88455b02658
Showing with 2 additions and 2 deletions.
  1. +2 −2 ui/jquery.ui.menu.js
@@ -132,13 +132,13 @@ $.widget("ui.menu", {
function escape(value) {
return value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
}
var match = self.widget().children(".ui-menu-item").filter(function() {
var match = self.activeMenu.children(".ui-menu-item").filter(function() {
return new RegExp("^" + escape(character), "i").test($(this).children("a").text());
});
var match = skip && match.index(self.active.next()) != -1 ? self.active.nextAll(".ui-menu-item") : match;
if (!match.length) {
character = String.fromCharCode(event.keyCode);
match = self.widget().children(".ui-menu-item").filter(function() {
match = self.activeMenu.children(".ui-menu-item").filter(function() {
return new RegExp("^" + escape(character), "i").test($(this).children("a").text());
});
}

0 comments on commit f0d5a00

Please sign in to comment.
You can’t perform that action at this time.