Skip to content

Commit

Permalink
[SafetyCheck] Fix intercepting keys
Browse files Browse the repository at this point in the history
The functionality for ctrl+z introduced by CL 4037744 captured keys, and
ran preventDefault() on the associated event, intercepting and blocking
any key presses on the page. This CL removes those calls and fixes this
issue.

Bug: 1345920, 1392664
Change-Id: I4285097bdce0cc1b7746a0014b684b6d3425421f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4071806
Reviewed-by: Rainhard Findling <rainhard@chromium.org>
Commit-Queue: Tom Van Goethem <tov@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1078523}
  • Loading branch information
tomvangoethem authored and Chromium LUCI CQ committed Dec 2, 2022
1 parent d1db25b commit 5c0209c
Showing 1 changed file with 0 additions and 3 deletions.
Expand Up @@ -352,7 +352,6 @@ export class SettingsReviewNotificationPermissionsElement extends
private onKeyDown_(e: KeyboardEvent) {
// Only allow undoing via ctrl+z when the undo toast is opened.
if (!this.$.undoToast.open) {
e.preventDefault();
return;
}

Expand All @@ -365,7 +364,6 @@ export class SettingsReviewNotificationPermissionsElement extends
* and ctrl on mac).
*/
if (e.key !== 'z') {
e.preventDefault();
return;
}
const excludedModifiers = [e.altKey, e.shiftKey];
Expand All @@ -379,7 +377,6 @@ export class SettingsReviewNotificationPermissionsElement extends
// </if>
if (!excludedModifiers.some(Boolean) && targetModifier) {
this.undoLastAction();
e.preventDefault();
}
}

Expand Down

0 comments on commit 5c0209c

Please sign in to comment.