mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 19:56:47 +03:00
make sure we don't break any A or BUTTON keyboard handling
This commit is contained in:
parent
10a74696b3
commit
4bde0c08ad
1 changed files with 5 additions and 6 deletions
|
@ -374,12 +374,11 @@ const LoggedInView = React.createClass({
|
||||||
const focusedOnInputControl = targetTag === "INPUT" ||
|
const focusedOnInputControl = targetTag === "INPUT" ||
|
||||||
targetTag === "TEXTAREA" ||
|
targetTag === "TEXTAREA" ||
|
||||||
targetTag === "SELECT" ||
|
targetTag === "SELECT" ||
|
||||||
ev.target.getAttribute("contenteditable");
|
!!ev.target.getAttribute("contenteditable");
|
||||||
// we don't check for buttons that have focus here,
|
const isClickShortcut = ev.target !== document.body &&
|
||||||
// because they should be using AccessibleButton which
|
(ev.key === "Space" || ev.key === "Enter");
|
||||||
// calls stopPropagation on space or enter keydown, so
|
|
||||||
// that keydown event would never get here.
|
if (!focusedOnInputControl && !isClickShortcut) {
|
||||||
if (!focusedOnInputControl) {
|
|
||||||
dis.dispatch({action: 'focus_composer'}, true);
|
dis.dispatch({action: 'focus_composer'}, true);
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
// we should *not* preventDefault() here as
|
// we should *not* preventDefault() here as
|
||||||
|
|
Loading…
Reference in a new issue