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

Unified Diff: chrome/browser/resources/md_bookmarks/list.js

Issue 2885353002: MD Bookmarks: Prevent keyboard shortcuts when the toolbar/dialogs are focused (Closed)
Patch Set: Add a test Created 3 years, 6 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
Index: chrome/browser/resources/md_bookmarks/list.js
diff --git a/chrome/browser/resources/md_bookmarks/list.js b/chrome/browser/resources/md_bookmarks/list.js
index f960e2eb5243cc862611af4093176d11d3436e3d..cb0bdb9a9e8b464876d9698c91f35c2b7826c86e 100644
--- a/chrome/browser/resources/md_bookmarks/list.js
+++ b/chrome/browser/resources/md_bookmarks/list.js
@@ -179,6 +179,15 @@ Polymer({
}
}
+ // Prevent the iron-list from changing focus on enter.
+ if (e.path[0] instanceof HTMLButtonElement && e.key == 'Enter')
+ handled = true;
+
+ if (!handled) {
+ handled = bookmarks.CommandManager.getInstance().handleKeyEvent(
+ e, this.getState().selection.items);
+ }
+
if (handled)
e.stopPropagation();
},
« no previous file with comments | « chrome/browser/resources/md_bookmarks/list.html ('k') | chrome/test/data/webui/md_bookmarks/command_manager_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698