Skip to content

Commit

Permalink
Don't use bulk version of updateBlockAttributes() for now. It seems b…
Browse files Browse the repository at this point in the history
…roken
  • Loading branch information
noisysocks committed Jul 11, 2024
1 parent 297f80b commit 9c5e811
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,12 @@ export function useGridLayoutSync( { clientId: gridClientId } ) {
}
}

if ( Object.keys( updates ).length ) {
// TODO: We should be able to replace this with a single call to updateBlockAttributes(),
// but there seems to be a bug where getBlocks() selectors don't always update when
// updating attributes this way.
for ( const [ clientId, attributes ] of Object.entries( updates ) ) {
__unstableMarkNextChangeAsNotPersistent();
updateBlockAttributes(
Object.keys( updates ),
updates,
/* uniqueByBlock: */ true
);
updateBlockAttributes( clientId, attributes );
}
}, [
// Actual deps to sync:
Expand Down

0 comments on commit 9c5e811

Please sign in to comment.