From 77f5274cd86123ae591660f950061b3a7406faa6 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 19 Jul 2019 09:10:20 +0200 Subject: [PATCH] don't focus composer on keydown with modifier this breaks shortcuts like copy, ... --- src/components/structures/LoggedInView.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/structures/LoggedInView.js b/src/components/structures/LoggedInView.js index e3a99a42ca..f6443deec3 100644 --- a/src/components/structures/LoggedInView.js +++ b/src/components/structures/LoggedInView.js @@ -326,11 +326,12 @@ const LoggedInView = React.createClass({ let handled = false; const ctrlCmdOnly = isOnlyCtrlOrCmdKeyEvent(ev); + const hasModifier = ev.altKey || ev.ctrlKey || ev.metaKey || ev.shiftKey; switch (ev.keyCode) { case KeyCode.PAGE_UP: case KeyCode.PAGE_DOWN: - if (!ev.ctrlKey && !ev.shiftKey && !ev.altKey && !ev.metaKey) { + if (!hasModifier) { this._onScrollKeyPressed(ev); handled = true; } @@ -369,7 +370,7 @@ const LoggedInView = React.createClass({ if (handled) { ev.stopPropagation(); ev.preventDefault(); - } else { + } else if (!hasModifier) { const targetTag = ev.target.tagName; const focusedOnInputControl = targetTag === "INPUT" || targetTag === "TEXTAREA" ||