Skip to content

Commit

Permalink
Hide Image block resizer when inside a grid layout. (#61603)
Browse files Browse the repository at this point in the history
Co-authored-by: tellthemachines <[email protected]>
Co-authored-by: andrewserong <[email protected]>
  • Loading branch information
3 people authored May 13, 2024
1 parent afd7594 commit 0a10502
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/block-library/src/image/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export function ImageEdit( {
onReplace,
context,
clientId,
__unstableParentLayout: parentLayout,
} ) {
const {
url = '',
Expand Down Expand Up @@ -385,6 +386,7 @@ export function ImageEdit( {
context={ context }
clientId={ clientId }
blockEditingMode={ blockEditingMode }
parentLayoutType={ parentLayout?.type }
/>
<MediaPlaceholder
icon={ <BlockIcon icon={ icon } /> }
Expand Down
4 changes: 3 additions & 1 deletion packages/block-library/src/image/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export default function Image( {
context,
clientId,
blockEditingMode,
parentLayoutType,
} ) {
const {
url = '',
Expand Down Expand Up @@ -181,7 +182,8 @@ export default function Image( {
allowResize &&
hasNonContentControls &&
! isWideAligned &&
isLargeViewport;
isLargeViewport &&
parentLayoutType !== 'grid';
const imageSizeOptions = imageSizes
.filter(
( { slug } ) => image?.media_details?.sizes?.[ slug ]?.source_url
Expand Down

0 comments on commit 0a10502

Please sign in to comment.