Skip to content

Commit

Permalink
Use forceSelectionUpdate to set caret position. (#14957)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkevins authored Apr 13, 2019
1 parent 85edc75 commit 5fb26b6
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,7 @@ export class RichText extends Component {
this.lastContent = newContent;

// explicitly set selection after inline paste
( ( { start, end } ) => this.setState( { start, end,
needsSelectionUpdate: true } ) )( insertedContent );
this.forceSelectionUpdate( insertedContent.start, insertedContent.end );

this.props.onChange( this.lastContent );
} else if ( onSplit ) {
Expand Down

0 comments on commit 5fb26b6

Please sign in to comment.