| Index: third_party/polymer/v1_0/components-chromium/iron-menu-behavior/iron-menu-behavior-extracted.js
|
| diff --git a/third_party/polymer/v1_0/components-chromium/iron-menu-behavior/iron-menu-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-menu-behavior/iron-menu-behavior-extracted.js
|
| index 5a2f4206f3f6b1f86b733074788eb98120a4de78..bb0ed59e2e21ff20d5f661090b23079d7bca2f0c 100644
|
| --- a/third_party/polymer/v1_0/components-chromium/iron-menu-behavior/iron-menu-behavior-extracted.js
|
| +++ b/third_party/polymer/v1_0/components-chromium/iron-menu-behavior/iron-menu-behavior-extracted.js
|
| @@ -128,11 +128,18 @@
|
| _focusPrevious: function() {
|
| var length = this.items.length;
|
| var curFocusIndex = Number(this.indexOf(this.focusedItem));
|
| +
|
| for (var i = 1; i < length + 1; i++) {
|
| var item = this.items[(curFocusIndex - i + length) % length];
|
| if (!item.hasAttribute('disabled')) {
|
| + var owner = Polymer.dom(item).getOwnerRoot() || document;
|
| this._setFocusedItem(item);
|
| - return;
|
| +
|
| + // Focus might not have worked, if the element was hidden or not
|
| + // focusable. In that case, try again.
|
| + if (Polymer.dom(owner).activeElement == item) {
|
| + return;
|
| + }
|
| }
|
| }
|
| },
|
| @@ -145,11 +152,18 @@
|
| _focusNext: function() {
|
| var length = this.items.length;
|
| var curFocusIndex = Number(this.indexOf(this.focusedItem));
|
| +
|
| for (var i = 1; i < length + 1; i++) {
|
| var item = this.items[(curFocusIndex + i) % length];
|
| if (!item.hasAttribute('disabled')) {
|
| + var owner = Polymer.dom(item).getOwnerRoot() || document;
|
| this._setFocusedItem(item);
|
| - return;
|
| +
|
| + // Focus might not have worked, if the element was hidden or not
|
| + // focusable. In that case, try again.
|
| + if (Polymer.dom(owner).activeElement == item) {
|
| + return;
|
| + }
|
| }
|
| }
|
| },
|
|
|