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

Unified Diff: chrome/browser/resources/settings/focusable_iron_list_item_behavior.js

Issue 2745653003: MD Settings: fix unnecessary focus on list items. (Closed)
Patch Set: fixes based on comments Created 3 years, 9 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 | « no previous file | chrome/test/data/webui/settings/focusable_iron_list_item_behavior_test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/settings/focusable_iron_list_item_behavior.js
diff --git a/chrome/browser/resources/settings/focusable_iron_list_item_behavior.js b/chrome/browser/resources/settings/focusable_iron_list_item_behavior.js
index 997217725eff9085ef543e0f71eba81e2062a6d6..20e58c5b7db3efe8ef953cdc7253e5ea82a0e0e5 100644
--- a/chrome/browser/resources/settings/focusable_iron_list_item_behavior.js
+++ b/chrome/browser/resources/settings/focusable_iron_list_item_behavior.js
@@ -29,10 +29,15 @@ var FocusableIronListItemBehavior = {
/**
* Unflag when moving away via keyboard (e.g. tabbing onto its children).
+ * @param {!Event} event
* @private
*/
- onKeyDown_: function() {
+ onKeyDown_: function(event) {
this.focusedByKey_ = false;
+
+ // For these types of items, don't propagate enter to iron-list's listener.
+ if (event.key == 'Enter')
+ event.stopPropagation();
},
/**
« no previous file with comments | « no previous file | chrome/test/data/webui/settings/focusable_iron_list_item_behavior_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698