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

Unified Diff: chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.js

Issue 2945433002: MD Settings: fix incorrect behavior with Enter on bluetooth item's icon-button. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.js
diff --git a/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.js b/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.js
index 5f0dee2bdde2c6d898c54f88284cb7e8b9f86980..048908d6c0e965dd87820fafb6bdd92301b182b2 100644
--- a/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.js
+++ b/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.js
@@ -21,6 +21,24 @@ Polymer({
},
},
+ listeners: {
+ 'keydown': 'onKeyDown_',
+ },
+
+ /**
+ * This is necessary, otherwise pressing enter will first trigger iron-list's
+ * keydown handler and intefere with icon-button's on-tap behavior.
+ * @param {!Event} event
+ * @private
+ */
+ onKeyDown_: function(event) {
+ if (event.key == 'Enter' &&
+ Polymer.dom(event).rootTarget ==
+ this.$$('button[is="paper-icon-button-light"]')) {
+ event.stopPropagation();
+ }
+ },
dschuyler 2017/06/20 18:46:51 When we have a chance, I'd like to chat about whet
scottchen 2017/06/20 19:17:19 I think we might've talked about this before, but
stevenjb 2017/07/10 22:48:53 Can this be done more simply like: <button ... on
scottchen 2017/07/12 19:12:49 Looks like yes we can! PTAL.
+
/**
* @param {!Event} event
* @private
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698