Skip to content

Commit

Permalink
Fix issue with block invalidation on first load
Browse files Browse the repository at this point in the history
  • Loading branch information
glendaviesnz committed May 3, 2023
1 parent 847a811 commit aaab236
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/block-library/src/pattern/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
*/
import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';

export default function save( { attributes: { inheritedAlignment } } ) {
export default function save( {
attributes: { inheritedAlignment },
innerBlocks,
} ) {
if ( innerBlocks?.length === 0 ) {
return;
}
const blockProps = useBlockProps.save( {
className: inheritedAlignment && `align${ inheritedAlignment }`,
} );
Expand Down

0 comments on commit aaab236

Please sign in to comment.