How to fix this issue on viewing a product in magento 2? The image is set on that height and width on page load but when you select any color in the choices, the product size restores enter image description here

this is the how it looks when you selected a color... enter image description here

1 Answer 1


I fixed it, it seems it was a bootstrap issue, Bootstrap was forcing the product media container to be a display:flex; and the javascript needs it to be a display:block;

I added this to my CSS and this fixed it.

.page-layout-1column .product.media { display: block !important; }

  • not working on my case. facing same issue.
    – Mahendra
    Apr 18, 2019 at 5:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.