mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 14:05:04 +08:00
don't focus composer on keydown with modifier
this breaks shortcuts like copy, ...
This commit is contained in:
parent
4fa7302f69
commit
77f5274cd8
@ -326,11 +326,12 @@ const LoggedInView = React.createClass({
|
|||||||
|
|
||||||
let handled = false;
|
let handled = false;
|
||||||
const ctrlCmdOnly = isOnlyCtrlOrCmdKeyEvent(ev);
|
const ctrlCmdOnly = isOnlyCtrlOrCmdKeyEvent(ev);
|
||||||
|
const hasModifier = ev.altKey || ev.ctrlKey || ev.metaKey || ev.shiftKey;
|
||||||
|
|
||||||
switch (ev.keyCode) {
|
switch (ev.keyCode) {
|
||||||
case KeyCode.PAGE_UP:
|
case KeyCode.PAGE_UP:
|
||||||
case KeyCode.PAGE_DOWN:
|
case KeyCode.PAGE_DOWN:
|
||||||
if (!ev.ctrlKey && !ev.shiftKey && !ev.altKey && !ev.metaKey) {
|
if (!hasModifier) {
|
||||||
this._onScrollKeyPressed(ev);
|
this._onScrollKeyPressed(ev);
|
||||||
handled = true;
|
handled = true;
|
||||||
}
|
}
|
||||||
@ -369,7 +370,7 @@ const LoggedInView = React.createClass({
|
|||||||
if (handled) {
|
if (handled) {
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
} else {
|
} else if (!hasModifier) {
|
||||||
const targetTag = ev.target.tagName;
|
const targetTag = ev.target.tagName;
|
||||||
const focusedOnInputControl = targetTag === "INPUT" ||
|
const focusedOnInputControl = targetTag === "INPUT" ||
|
||||||
targetTag === "TEXTAREA" ||
|
targetTag === "TEXTAREA" ||
|
||||||
|
Loading…
Reference in New Issue
Block a user