Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Don't focus composer on keydown with modifier #3237

Merged
merged 1 commit into from
Jul 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/components/structures/LoggedInView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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" ||
Expand Down