diff options
author | jzaefferer <joern.zaefferer@gmail.com> | 2011-02-24 10:50:08 +0100 |
---|---|---|
committer | jzaefferer <joern.zaefferer@gmail.com> | 2011-02-24 11:14:19 +0100 |
commit | 6bd95efe5e1a6f013a1efee73f9ce468013c2c35 (patch) | |
tree | 70b0c17e88b49c59782fc49919c18e063a0e0be0 /ui | |
parent | 5d3f91bcbef40832e6eb45a6b4f519353fbe2529 (diff) | |
download | jquery-ui-6bd95efe5e1a6f013a1efee73f9ce468013c2c35.tar.gz jquery-ui-6bd95efe5e1a6f013a1efee73f9ce468013c2c35.zip |
Menu: Fix filter matching to work with flyout menu
Diffstat (limited to 'ui')
-rw-r--r-- | ui/jquery.ui.menu.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js index cc221f943..d7c0f5c74 100644 --- a/ui/jquery.ui.menu.js +++ b/ui/jquery.ui.menu.js @@ -88,6 +88,7 @@ $.widget("ui.menu", { event.stopImmediatePropagation(); break; default: + event.stopPropagation(); clearTimeout(self.filterTimer); var prev = self.previousFilter || ""; var character = String.fromCharCode(event.keyCode); @@ -101,13 +102,13 @@ $.widget("ui.menu", { return value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); } var match = self.widget().children(".ui-menu-item").filter(function() { - return new RegExp("^" + escape(character), "i").test($(this).text()); + 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() { - return new RegExp("^" + escape(character), "i").test($(this).text()); + return new RegExp("^" + escape(character), "i").test($(this).children("a").text()); }); } if (match.length) { |