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

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

Issue 2884113002: WebUI: Stop keypresses on the close icon from firing the Enter handler. (Closed)
Patch Set: update tests 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 1f66df481d6c26cd2418ceac0ed1083c9db4330f..7b0d54880169e0d9213c68f8997701e9328560e5 100644
--- a/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js
+++ b/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js
@@ -142,6 +142,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