diff --git a/assets/js/blocks/featured-product/block.js b/assets/js/blocks/featured-product/block.js index 9e35af837d3..3123068905c 100644 --- a/assets/js/blocks/featured-product/block.js +++ b/assets/js/blocks/featured-product/block.js @@ -464,6 +464,7 @@ const FeaturedProduct = ( { contentAlign, dimRatio, focalPoint, + hasParallax, isRepeated, imageFit, mediaSrc, @@ -500,7 +501,7 @@ const FeaturedProduct = ( { objectFit: imageFit, }; - const isImgElement = ! isRepeated; + const isImgElement = ! isRepeated && ! hasParallax; const wrapperStyle = { ...( ! isImgElement @@ -513,6 +514,10 @@ const FeaturedProduct = ( { : undefined ), ...getSpacingClassesAndStyles( attributes ).style, minHeight, + ...( ! isRepeated && { + backgroundRepeat: 'no-repeat', + backgroundSize: imageFit === 'cover' ? imageFit : 'auto', + } ), }; const overlayStyle = { @@ -530,7 +535,10 @@ const FeaturedProduct = ( { />
get_image_url( $attributes, $product ) ); - $styles = $this->get_styles( $attributes, $image_url ); - $classes = $this->get_classes( $attributes ); + $styles = $this->get_styles( $attributes, $image_url ); + $classes = $this->get_classes( $attributes ); + $wrapper_classes = $this->get_wrapper_classes( $attributes ); $output = sprintf( '