@@ -509,11 +509,14 @@ export class ImageEdit extends Component {
509509 image,
510510 clientId,
511511 imageDefaultSize,
512- context : { imageCrop = false } = { } ,
512+ context,
513513 featuredImageId,
514514 wasBlockJustInserted,
515515 } = this . props ;
516516 const { align, url, alt, id, sizeSlug, className } = attributes ;
517+ const hasImageContext = context
518+ ? Object . keys ( context ) . length > 0
519+ : false ;
517520
518521 const imageSizes = Array . isArray ( this . props . imageSizes )
519522 ? this . props . imageSizes
@@ -627,9 +630,11 @@ export class ImageEdit extends Component {
627630
628631 const additionalImageProps = {
629632 height : '100%' ,
630- resizeMode : imageCrop ? 'cover' : 'contain' ,
633+ resizeMode : context ?. imageCrop ? 'cover' : 'contain' ,
631634 } ;
632635
636+ const imageContainerStyles = [ hasImageContext && styles . fixedHeight ] ;
637+
633638 const getImageComponent = ( openMediaOptions , getMediaOptions ) => (
634639 < Badge label = { __ ( 'Featured' ) } show = { isFeaturedImage } >
635640 < TouchableWithoutFeedback
@@ -662,7 +667,7 @@ export class ImageEdit extends Component {
662667 retryMessage,
663668 } ) => {
664669 return (
665- < View style = { styles . isGallery } >
670+ < View style = { imageContainerStyles } >
666671 < Image
667672 align = {
668673 align && alignToFlex [ align ]
@@ -686,7 +691,9 @@ export class ImageEdit extends Component {
686691 url = { url }
687692 shapeStyle = { styles [ className ] }
688693 width = { this . getWidth ( ) }
689- { ...additionalImageProps }
694+ { ...( hasImageContext
695+ ? additionalImageProps
696+ : { } ) }
690697 />
691698 </ View >
692699 ) ;
0 commit comments