Commit 5865a897 authored by Demetrios Papadopoulos's avatar Demetrios Papadopoulos Committed by Commit Bot

Revert "Don't propagate keydown events when dialog is open"

This reverts commit ab21d472.

Reason for revert: Broke
 - Print preview 'esc' behavior when dialog is open
 - Settings add-language-dialog ctrl+f behavior

Original change's description:
> Don't propagate keydown events when dialog is open
> 
> We shouldn't propagate keydown events so that it can
> behave modally.
> 
> Bug: 883221
> Cq-Include-Trybots: luci.chromium.try:closure_compilation
> Change-Id: I4aa5257b4bf6c417123d659ba911cb01641a4cc7
> Reviewed-on: https://chromium-review.googlesource.com/1230493
> Reviewed-by: Scott Chen <scottchen@chromium.org>
> Commit-Queue: Sang Woo Ko <sangwoo108@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#593619}

TBR=calamity@chromium.org,scottchen@chromium.org,sangwoo108@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 883221
Change-Id: I8f044d3e62ffce565a0761327b6aa877d1463224
Cq-Include-Trybots: luci.chromium.try:closure_compilation
Reviewed-on: https://chromium-review.googlesource.com/1249809Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594871}
parent 2d4bc971
......@@ -745,7 +745,6 @@ Sanghee Lee <sanghee.lee1992@gmail.com>
Sanghyun Park <sh919.park@samsung.com>
Sanghyup Lee <sh53.lee@samsung.com>
Sangjoon Je <htamop@gmail.com>
Sangwoo Ko <sangwoo.ko@navercorp.com>
Sangwoo Ko <sangwoo108@gmail.com>
Sanjoy Pal <ncj674@motorola.com>
Sanjoy Pal <sanjoy.pal@samsung.com>
......
......@@ -114,10 +114,6 @@ suite('<bookmarks-command-manager>', function() {
MockInteractions.pressAndReleaseKeyOn(document.body, '', [], key);
commandManager.assertLastCommand(Command.EDIT, ['13']);
// close dialog for other tests.
const dialog = commandManager.$.editDialog.getIfExists();
dialog.onCancelButtonTap_();
// Doesn't trigger when multiple items are selected.
store.data.selection.items = new Set(['11', '13']);
store.notifyObservers();
......
......@@ -69,7 +69,6 @@ Polymer({
listeners: {
'pointerdown': 'onPointerdown_',
'keydown': 'onKeydown_',
},
/** @private {?IntersectionObserver} */
......@@ -109,11 +108,6 @@ Polymer({
// In some cases dialog already has the 'open' attribute by this point.
mutationObserverCallback();
// Sometimes <body> is key event's target and in that case the event
// will bypass cr-dialog. We should consume those events too in order to
// behave modally. This prevents accidentally triggering command manager.
document.body.addEventListener('keydown', this.onKeydown_.bind(this));
},
/** @override */
......@@ -271,21 +265,6 @@ Polymer({
}
},
/**
* @param {!Event} e
* @private
*/
onKeydown_: function(e) {
if (!this.getNative().open)
return;
if (this.ignoreEnterKey && e.key == 'Enter')
return;
// Stop propagation to behave modally.
e.stopPropagation();
},
/** @param {!PointerEvent} e */
onPointerdown_: function(e) {
// Only show pulse animation if user left-clicked outside of the dialog
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment