add comments

pull/21833/head
Bruno Windels 2019-07-23 09:44:17 +02:00
parent 023130bb4b
commit 82d7617287
1 changed files with 4 additions and 0 deletions

View File

@ -288,6 +288,9 @@ const LoggedInView = React.createClass({
element = element.parentElement; element = element.parentElement;
} }
if (!canReceiveInput) { if (!canReceiveInput) {
// refocusing during a paste event will make the
// paste end up in the newly focused element,
// so dispatch synchronously before paste happens
dis.dispatch({action: 'focus_composer'}, true); dis.dispatch({action: 'focus_composer'}, true);
} }
}, },
@ -395,6 +398,7 @@ const LoggedInView = React.createClass({
(ev.key === "Space" || ev.key === "Enter"); (ev.key === "Space" || ev.key === "Enter");
if (!isClickShortcut && !canElementReceiveInput(ev.target)) { if (!isClickShortcut && !canElementReceiveInput(ev.target)) {
// synchronous dispatch so we focus before key generates input
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