Skip to content

Commit

Permalink
Hide aspectRatio control from global styles for the group block
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewserong committed Jan 24, 2024
1 parent 2c9107d commit 39873bf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/edit-site/src/components/global-styles/screen-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@ function ScreenBlock( { name, variation } ) {
settings.spacing.blockGap = false;
}

// Only allow `aspectRatio` support if the block is not the grouping block.
// The grouping block allows the user to use Group, Row and Stack variations,
// and it is highly likely that the user will not want to set an aspect ratio
// for all three at once. Until there is the ability to set a different aspect
// ratio for each variation, we disable the aspect ratio controls for the
// grouping block in global styles.
if ( settings?.dimensions?.aspectRatio && name === 'core/group' ) {
settings.dimensions.aspectRatio = false;
}

const blockVariations = useBlockVariations( name );
const hasTypographyPanel = useHasTypographyPanel( settings );
const hasColorPanel = useHasColorPanel( settings );
Expand Down

0 comments on commit 39873bf

Please sign in to comment.