Skip to content

Commit

Permalink
Go back to running always bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
SantosGuillamot committed Jun 25, 2024
1 parent 46d01ad commit e1bdd7e
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions packages/block-editor/src/hooks/use-bindings-attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,20 +177,6 @@ export const withBlockBindingSupport = createHigherOrderComponent(

const keptAttributes = { ...nextAttributes };

// Don't run bindings logic when a block is using pattern overrides but
// the user is editing the original pattern.
if (
! hasParentPattern &&
hasPatternOverridesDefaultBinding
) {
// Don't update caption and href in pattern overrides until they are supported.
delete keptAttributes?.caption;
delete keptAttributes?.href;

setAttributes( keptAttributes );
return;
}

const updatesBySource = new Map();

// Loop only over the updated attributes to avoid modifying the bound ones that haven't changed.
Expand Down Expand Up @@ -247,13 +233,20 @@ export const withBlockBindingSupport = createHigherOrderComponent(
}
}

// Only apply normal attribute updates to blocks
// that have partial bindings. Currently this is
// only skipped for pattern overrides sources.
if (
! hasPatternOverridesDefaultBinding &&
// Don't update non-connected attributes if the block is using pattern overrides
// and the editing is happening while overriding the pattern (not editing the original).
! (
hasPatternOverridesDefaultBinding &&
hasParentPattern
) &&
Object.keys( keptAttributes ).length
) {
// Don't update caption and href until they are supported.
if ( hasPatternOverridesDefaultBinding ) {
delete keptAttributes?.caption;
delete keptAttributes?.href;
}
setAttributes( keptAttributes );
}
} );
Expand Down

0 comments on commit e1bdd7e

Please sign in to comment.