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

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: Complete rewrite Created 3 years, 7 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 75810eaaddfd5c0710b7cc919e29a4d1c6105137..8a2d92233e722b1b625d060703606effca3440ff 100644
--- a/chrome/browser/resources/md_bookmarks/list.js
+++ b/chrome/browser/resources/md_bookmarks/list.js
@@ -177,6 +177,16 @@ Polymer({
}
}
+ // Prevent the iron-list from changing focus on enter.
+ if (e.path[0] instanceof HTMLButtonElement && e.key == 'Enter') {
calamity 2017/06/06 07:15:11 🤡🎪 Remove braces. Might be worth writing a test
tsergeant 2017/06/06 08:10:48 Done.
+ 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