Merge pull request #3237 from matrix-org/bwindels/fixcpfocus

Don't focus composer on keydown with modifier
This commit is contained in:
Bruno Windels 2019-07-19 08:54:54 +00:00 committed by GitHub
commit 3ee26b6135
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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" ||