Skip to content

Commit

Permalink
RichText: comment isEqual checks to avoid regressing in the future
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Feb 26, 2018
1 parent 07dbbb0 commit bb56c0e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions blocks/rich-text/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,10 @@ export class RichText extends Component {
this.props.tagName === prevProps.tagName &&
this.props.value !== prevProps.value &&
this.props.value !== this.savedContent &&

// Comparing using isEqual is necessary especially to avoid unnecessary updateContent calls
// This fixes issues in multi richText blocks like quotes when moving the focus between
// the different editables.
! isEqual( this.props.value, prevProps.value ) &&
! isEqual( this.props.value, this.savedContent )
) {
Expand Down

0 comments on commit bb56c0e

Please sign in to comment.