Skip to content

Commit

Permalink
[Mobile] Fix caret position after inline paste. (WordPress#14893)
Browse files Browse the repository at this point in the history
* Fix caret position after inline paste.
  • Loading branch information
mkevins authored and mchowning committed Apr 15, 2019
1 parent ab13f95 commit 57211df
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,11 @@ export class RichText extends Component {
const newContent = this.valueToFormat( insertedContent );
this.lastEventCount = undefined;
this.lastContent = newContent;

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

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

0 comments on commit 57211df

Please sign in to comment.