Merge pull request #3515 from matrix-org/t3chguy/fix_backspace_slate_death

Fix backspace without slate focus killing everything
pull/21833/head
Michael Telatynski 2019-10-03 21:31:58 +01:00 committed by GitHub
commit e4691ced97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -401,6 +401,12 @@ const LoggedInView = createReactClass({
const isClickShortcut = ev.target !== document.body &&
(ev.key === "Space" || ev.key === "Enter");
// XXX: Remove after CIDER replaces Slate completely: https://github.com/vector-im/riot-web/issues/11036
if (ev.key === "Backspace") {
ev.stopPropagation();
return;
}
if (!isClickShortcut && !canElementReceiveInput(ev.target)) {
// synchronous dispatch so we focus before key generates input
dis.dispatch({action: 'focus_composer'}, true);