From 0d0934add7d83d7b1eac6ca5f92c9b985eee58c9 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Mon, 9 Jul 2018 00:58:35 +0100 Subject: [PATCH] unbreak modifier+space (e.g. emoji insert on macOS) (cherry picked from commit c490f87) Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/rooms/MessageComposerInput.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/views/rooms/MessageComposerInput.js b/src/components/views/rooms/MessageComposerInput.js index 77cc3ca2de..24834d01d7 100644 --- a/src/components/views/rooms/MessageComposerInput.js +++ b/src/components/views/rooms/MessageComposerInput.js @@ -713,6 +713,10 @@ export default class MessageComposerInput extends React.Component { }; onSpace = (ev: KeyboardEvent, change: Change): Change => { + if (ev.metaKey || ev.altKey || ev.shiftKey || ev.ctrlKey) { + return; + } + // drop a point in history so the user can undo a word // XXX: this seems nasty but adding to history manually seems a no-go ev.preventDefault();