| 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 b3404038e940c5b524d78a40ae0a0c741476f212..5a2f4206f3f6b1f86b733074788eb98120a4de78 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
|
| @@ -123,11 +123,12 @@
|
| /**
|
| * Focuses the previous item (relative to the currently focused item) in the
|
| * menu, disabled items will be skipped.
|
| + * Loop until length + 1 to handle case of single item in menu.
|
| */
|
| _focusPrevious: function() {
|
| var length = this.items.length;
|
| var curFocusIndex = Number(this.indexOf(this.focusedItem));
|
| - for (var i = 1; i < length; i++) {
|
| + for (var i = 1; i < length + 1; i++) {
|
| var item = this.items[(curFocusIndex - i + length) % length];
|
| if (!item.hasAttribute('disabled')) {
|
| this._setFocusedItem(item);
|
| @@ -139,11 +140,12 @@
|
| /**
|
| * Focuses the next item (relative to the currently focused item) in the
|
| * menu, disabled items will be skipped.
|
| + * Loop until length + 1 to handle case of single item in menu.
|
| */
|
| _focusNext: function() {
|
| var length = this.items.length;
|
| var curFocusIndex = Number(this.indexOf(this.focusedItem));
|
| - for (var i = 1; i < length; i++) {
|
| + for (var i = 1; i < length + 1; i++) {
|
| var item = this.items[(curFocusIndex + i) % length];
|
| if (!item.hasAttribute('disabled')) {
|
| this._setFocusedItem(item);
|
|
|