From 8b8260c509c8ae7234c6e4d935191a6b37603068 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 29 Jun 2017 17:22:34 +0100 Subject: [PATCH] Move cursor to end of editor when quoting When quoting a message, move the selection to the end of the input box. Fixes https://github.com/vector-im/riot-web/issues/2336 --- src/components/views/rooms/MessageComposerInput.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/views/rooms/MessageComposerInput.js b/src/components/views/rooms/MessageComposerInput.js index 8764356365..baa9761bd7 100644 --- a/src/components/views/rooms/MessageComposerInput.js +++ b/src/components/views/rooms/MessageComposerInput.js @@ -229,7 +229,8 @@ export default class MessageComposerInput extends React.Component { if (this.state.isRichtextEnabled) { contentState = Modifier.setBlockType(contentState, startSelection, 'blockquote'); } - const editorState = EditorState.push(this.state.editorState, contentState, 'insert-characters'); + let editorState = EditorState.push(this.state.editorState, contentState, 'insert-characters'); + editorState = EditorState.moveSelectionToEnd(editorState); this.onEditorContentChanged(editorState); editor.focus(); }