Skip to content

Commit

Permalink
Update getBlockAttributes logic
Browse files Browse the repository at this point in the history
  • Loading branch information
SantosGuillamot committed May 24, 2024
1 parent 374fe72 commit bc4191e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/block-editor/src/store/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ export const getBlockAttributes = createRegistrySelector(
}
isProcessingBindings = true;

const newAttributes = { ...blockAttributes };
const context = select( STORE_NAME ).getBlockContext( clientId );

const sources = unlock(
select( blocksStore )
).getAllBlockBindingsSources();
Expand All @@ -170,20 +170,20 @@ export const getBlockAttributes = createRegistrySelector(
args: boundAttribute.args,
};

blockAttributes[ attributeName ] = source.getValue( args );
newAttributes[ attributeName ] = source.getValue( args );

if ( blockAttributes[ attributeName ] === undefined ) {
if ( newAttributes[ attributeName ] === undefined ) {
if ( attributeName === 'url' ) {
blockAttributes[ attributeName ] = null;
newAttributes[ attributeName ] = null;
} else {
blockAttributes[ attributeName ] =
newAttributes[ attributeName ] =
source.getPlaceholder?.( args );
}
}
}

isProcessingBindings = false;
return blockAttributes;
return newAttributes;
}
);

Expand Down

0 comments on commit bc4191e

Please sign in to comment.