Skip to content

Commit

Permalink
Block Editor: Assign Provider isSyncingOutcomingValue only when block…
Browse files Browse the repository at this point in the history
…s changing (#14955)
  • Loading branch information
aduth committed Apr 16, 2019
1 parent ee28180 commit 66146ca
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/block-editor/src/components/provider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,15 @@ class BlockEditorProvider extends Component {
// This happens when a previous input is explicitely marked as persistent.
( newIsPersistent && ! isPersistent )
) {
// When knowing the blocks value is changing, assign instance
// value to skip reset in subsequent `componentDidUpdate`.
if ( newBlocks !== blocks ) {
this.isSyncingOutcomingValue = true;
}

blocks = newBlocks;
isPersistent = newIsPersistent;

this.isSyncingOutcomingValue = true;
if ( isPersistent ) {
onChange( blocks );
} else {
Expand Down

0 comments on commit 66146ca

Please sign in to comment.