Skip to content

Commit

Permalink
Addressed feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
amitraj2203 committed Jun 28, 2024
1 parent 3cd98a8 commit 9284be9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/block-library/src/image/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,10 @@ export default function Image( {
<DimensionsTool
value={ { aspectRatio } }
onChange={ ( { aspectRatio: newAspectRatio } ) => {
setAttributes( { aspectRatio: newAspectRatio } );
setAttributes( {
aspectRatio: newAspectRatio,
scale: 'cover',
} );
} }
defaultAspectRatio="auto"
tools={ [ 'aspectRatio' ] }
Expand Down Expand Up @@ -864,7 +867,7 @@ export default function Image( {
/>
</ImageWrapper>
);
} else if ( ! isResizable ) {
} else if ( ! isResizable || parentLayoutType === 'grid' ) {
img = (
<div style={ { width, height, aspectRatio } }>
<ImageWrapper href={ href }>{ img }</ImageWrapper>
Expand Down

0 comments on commit 9284be9

Please sign in to comment.