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 authored and youknowriad committed Apr 15, 2019
1 parent e167221 commit df6a17c
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 @@ -99,10 +99,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 df6a17c

Please sign in to comment.