diff --git a/packages/block-library/src/cover/edit.js b/packages/block-library/src/cover/edit.js index e379797e2ef669..2b92d436844774 100644 --- a/packages/block-library/src/cover/edit.js +++ b/packages/block-library/src/cover/edit.js @@ -330,8 +330,10 @@ function CoverEdit( { ? `${ minHeight }${ minHeightUnit }` : minHeight; + const isImgElement = ! ( hasParallax || isRepeated ); + const style = { - ...( isImageBackground && ( hasParallax || isRepeated ) + ...( isImageBackground && ! isImgElement ? backgroundImageStyles( url ) : {} ), backgroundColor: overlayColor.color, @@ -342,7 +344,7 @@ function CoverEdit( { const mediaStyle = { objectPosition: // prettier-ignore - focalPoint && ! hasParallax + focalPoint && isImgElement ? `${ Math.round( focalPoint.x * 100 ) }% ${ Math.round( focalPoint.y * 100) }%` : undefined, }; @@ -595,7 +597,7 @@ function CoverEdit( { style={ { background: gradientValue } } /> ) } - { isImageBackground && ! hasParallax && ( + { isImageBackground && isImgElement && ( ) } - { isImageBackground && url && ! hasParallax && ( + { isImageBackground && isImgElement && url && (