mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Menu: Make keyboard focus matching take submenus into account
This commit is contained in:
parent
5076f233db
commit
f0d5a0008f
4
ui/jquery.ui.menu.js
vendored
4
ui/jquery.ui.menu.js
vendored
@ -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());
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user