Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(450)

Unified Diff: ui/webui/resources/cr_elements/cr_shared_menu/cr_shared_menu.js

Issue 2356643003: Fix cr-shared-menu focus issues. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/webui/cr_elements/cr_shared_menu_tests.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/cr_elements/cr_shared_menu/cr_shared_menu.js
diff --git a/ui/webui/resources/cr_elements/cr_shared_menu/cr_shared_menu.js b/ui/webui/resources/cr_elements/cr_shared_menu/cr_shared_menu.js
index 2b2706582b3ad8a4aa09d176fcdcadda1114fc66..2fc718e29bee9f67c588206ac0adb81d93ac2210 100644
--- a/ui/webui/resources/cr_elements/cr_shared_menu/cr_shared_menu.js
+++ b/ui/webui/resources/cr_elements/cr_shared_menu/cr_shared_menu.js
@@ -134,7 +134,8 @@ Polymer({
this.$.dropdown.restoreFocusOnClose = true;
var focusableChildren = Polymer.dom(this).querySelectorAll(
- '[tabindex]:not([hidden]),button:not([hidden])');
+ '[tabindex]:not([disabled]):not([hidden]),' +
+ 'button:not([disabled]):not([hidden])');
if (focusableChildren.length > 0) {
this.$.dropdown.focusTarget = focusableChildren[0];
this.firstFocus_ = focusableChildren[0];
@@ -173,7 +174,7 @@ Polymer({
var keyEvent = e.detail.keyboardEvent;
if (keyEvent.shiftKey && keyEvent.target == this.firstFocus_)
toFocus = this.lastFocus_;
- else if (keyEvent.target == this.lastFocus_)
+ else if (!keyEvent.shiftKey && keyEvent.target == this.lastFocus_)
toFocus = this.firstFocus_;
if (!toFocus)
« no previous file with comments | « chrome/test/data/webui/cr_elements/cr_shared_menu_tests.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698