Commit 95a989fc authored by xiyuan's avatar xiyuan Committed by Commit bot

Make Menu.findMenuItem_ return the first MenuItem.

This fixes the regression in http://crbug.com/480381 where 'activate'
event is not fired for menu items under a grouping div rather than
being direct children of a Menu. Also fixes js error when hovering
such menu items.

BUG=480381

Review URL: https://codereview.chromium.org/1095303004

Cr-Commit-Position: refs/heads/master@{#327080}
parent 44babbed
......@@ -88,7 +88,7 @@ cr.define('cr.ui', function() {
* @private
*/
findMenuItem_: function(node) {
while (node && node.parentNode != this) {
while (node && node.parentNode != this && !(node instanceof MenuItem)) {
node = node.parentNode;
}
return node ? assertInstanceof(node, MenuItem) : null;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment