Merge branch 'master' into master

This commit is contained in:
Tarun Thakurani 2018-09-23 11:53:24 +05:30 committed by GitHub
commit 34905eaa8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -173,9 +173,7 @@ class Wysiwyg extends React.Component {
if (selectedText !== '') {
return this.setState(
{
// Move the cursor to the end (this line forces the cursor to be at the end of the content)
// It may go at the end of the last block
editorState: EditorState.moveFocusToEnd(newEditorState),
editorState: newEditorState,
},
() => {
this.focus();
@ -309,7 +307,14 @@ class Wysiwyg extends React.Component {
const newContentState = this.createNewContentStateFromBlock(newBlock);
const newEditorState = this.createNewEditorState(newContentState, text);
return this.setState({ editorState: EditorState.moveFocusToEnd(newEditorState) });
return this.setState(
{
editorState: newEditorState,
},
() => {
this.focus();
},
);
};
/**