Skip to content

Commit

Permalink
If text already changed, don't modify it
Browse files Browse the repository at this point in the history
  • Loading branch information
hypest committed Apr 23, 2019
1 parent 0883192 commit 60c75b0
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,10 @@ export class RichText extends Component {
} );
this.onSplit( ...split( currentRecord ).map( this.valueToFormat ) );
} else {
const insertedLineSeparator = { needsSelectionUpdate: true, ...insertLineSeparator( currentRecord ) };
this.onFormatChangeForceChild( insertedLineSeparator );
if ( ! event.nativeEvent.firedAfterTextChanged ) {
const insertedLineSeparator = { needsSelectionUpdate: true, ...insertLineSeparator( currentRecord ) };
this.onFormatChangeForceChild( insertedLineSeparator );
}
}
} else if ( event.shiftKey || ! this.onSplit ) {
const insertedLineBreak = { needsSelectionUpdate: true, ...insert( currentRecord, '\n' ) };
Expand Down

0 comments on commit 60c75b0

Please sign in to comment.