Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Mar 27, 2019
1 parent 7a0feca commit 262e124
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/block-editor/src/components/rich-text/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,20 @@ export class RichText extends Component {
record = this.getLingeringRecord();
}

// To do: find a better way to move the caret to the end after merge.
// If the value's been changed from the outside and the instance is
// selected, set the caret at the end on focus (which sets
// this.lastState).
if ( this.props.isSelected && this.props.value !== this.savedContent ) {
const prevRecord = this.formatToValue( prevProps.value );
const length = getTextContent( prevRecord ).length;

this.lastState = {
start: length,
end: length,
};
}

this.applyRecord( record );
}

Expand Down

0 comments on commit 262e124

Please sign in to comment.