summaryrefslogtreecommitdiffstats
path: root/ui/webui
diff options
context:
space:
mode:
authorhirono@chromium.org <hirono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-09 10:19:12 +0000
committerhirono@chromium.org <hirono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-09 10:19:12 +0000
commit11585d653c45f4772c5ef25d7c035a99ab05e30f (patch)
tree41dd1306c40ebc30ae506d39c0da69df5d24aadc /ui/webui
parent74898626eaad915e2daf308d95b93cf84e98b8c0 (diff)
downloadchromium_src-11585d653c45f4772c5ef25d7c035a99ab05e30f.zip
chromium_src-11585d653c45f4772c5ef25d7c035a99ab05e30f.tar.gz
chromium_src-11585d653c45f4772c5ef25d7c035a99ab05e30f.tar.bz2
webui: Stop propagation of ESC key event in dialog boxes.
Originally ESC key event to close the dialog box is propagated to the container of dialog box and this causes an unexpected call of the container's handler. This CL add a call of stopPropagation to prevent it. BUG=282215 TEST=manually Review URL: https://codereview.chromium.org/26458003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227720 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/webui')
-rw-r--r--ui/webui/resources/js/cr/ui/dialogs.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/ui/webui/resources/js/cr/ui/dialogs.js b/ui/webui/resources/js/cr/ui/dialogs.js
index e6fd5ec..a871f7b 100644
--- a/ui/webui/resources/js/cr/ui/dialogs.js
+++ b/ui/webui/resources/js/cr/ui/dialogs.js
@@ -93,6 +93,9 @@ cr.define('cr.ui.dialogs', function() {
// Handle Escape.
if (event.keyCode == 27 && !this.cancelButton_.disabled) {
this.onCancelClick_(event);
+ event.stopPropagation();
+ // Prevent the event from being handled by the container of the dialog.
+ // e.g. Prevent the parent container from closing at the same time.
event.preventDefault();
}
};