mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 17:56:01 +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" ||
|
||||
targetTag === "TEXTAREA" ||
|
||||
targetTag === "SELECT" ||
|
||||
ev.target.getAttribute("contenteditable");
|
||||
// we don't check for buttons that have focus here,
|
||||
// because they should be using AccessibleButton which
|
||||
// calls stopPropagation on space or enter keydown, so
|
||||
// that keydown event would never get here.
|
||||
if (!focusedOnInputControl) {
|
||||
!!ev.target.getAttribute("contenteditable");
|
||||
const isClickShortcut = ev.target !== document.body &&
|
||||
(ev.key === "Space" || ev.key === "Enter");
|
||||
|
||||
if (!focusedOnInputControl && !isClickShortcut) {
|
||||
dis.dispatch({action: 'focus_composer'}, true);
|
||||
ev.stopPropagation();
|
||||
// we should *not* preventDefault() here as
|
||||
|
|
Loading…
Reference in a new issue