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

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

Issue 2891993002: WebUI: Stop keypresses on the close icon from firing the Enter handler. (Closed)
Patch Set: 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
« no previous file with comments | « ui/webui/resources/cr_elements/cr_dialog/cr_dialog.html ('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_dialog/cr_dialog.js
diff --git a/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js b/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js
index 3e9fc20ba55944730342044421ecc1ec773b8336..8f73731a03640d9da601133819e39fb5ef104e83 100644
--- a/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js
+++ b/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js
@@ -147,6 +147,16 @@ Polymer({
HTMLDialogElement.prototype.close.call(this, 'success');
},
+ /**
+ * @private
+ * @param {Event} e
+ */
+ onCloseKeypress_: function(e) {
+ // Because the dialog may have a default Enter key handler, prevent
+ // keypress events from bubbling up from this element.
+ e.stopPropagation();
+ },
+
/** @return {!PaperIconButtonElement} */
getCloseButton: function() {
return this.$.close;
« no previous file with comments | « ui/webui/resources/cr_elements/cr_dialog/cr_dialog.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698