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
pull/21833/head
Luke Barnard 2017-06-29 17:22:34 +01:00
parent a2d6918562
commit 8b8260c509
1 changed files with 2 additions and 1 deletions

View File

@ -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();
}