From a9b4abaf78caba69deb844bb3a71f02974cdd79d Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 3 Oct 2019 21:16:18 +0100 Subject: [PATCH] Fix backspace without slate focus killing everything Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/LoggedInView.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/structures/LoggedInView.js b/src/components/structures/LoggedInView.js index 5529fb8f32..66210e2f93 100644 --- a/src/components/structures/LoggedInView.js +++ b/src/components/structures/LoggedInView.js @@ -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);