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
This commit is contained in:
Luke Barnard 2017-06-29 17:22:34 +01:00
parent a2d6918562
commit 8b8260c509

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