From 8bb08b1b75c6f38f472269fc452800eeec079c27 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 18 Jul 2018 10:10:11 +0100 Subject: [PATCH] fix focus on new editorState as it didn't have focus so broke when alt tab Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/rooms/MessageComposerInput.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/MessageComposerInput.js b/src/components/views/rooms/MessageComposerInput.js index 1850601d8a..c5aafaa587 100644 --- a/src/components/views/rooms/MessageComposerInput.js +++ b/src/components/views/rooms/MessageComposerInput.js @@ -330,8 +330,9 @@ export default class MessageComposerInput extends React.Component { } return editorState; } else { - // ...or create a new one. - return Plain.deserialize('', { defaultBlock: DEFAULT_NODE }); + // ...or create a new one. and explicitly focus it otherwise tab in-out issues + const base = Plain.deserialize('', { defaultBlock: DEFAULT_NODE }); + return base.change().focus().value; } }