From a89018396bf5714d9bf33ba1af67b268d88b07ff Mon Sep 17 00:00:00 2001 From: vinaykumargujja Date: Mon, 4 Dec 2023 16:04:42 +0530 Subject: [PATCH] fixed zoomed image mobile issuel --- blocks/model-image/model-image.css | 6 +++++- blocks/model-image/model-image.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/blocks/model-image/model-image.css b/blocks/model-image/model-image.css index be3179f9..6d289cbf 100644 --- a/blocks/model-image/model-image.css +++ b/blocks/model-image/model-image.css @@ -157,8 +157,12 @@ max-height: 80vh; overflow: auto; - @media only screen and (max-width: 860px) { + @media (max-width: 860px) { width: calc(100vw - 100px); } + @media (max-width: 768px) { + width: calc(100vw - 40px); + } + } diff --git a/blocks/model-image/model-image.js b/blocks/model-image/model-image.js index 802743c9..7642cec4 100644 --- a/blocks/model-image/model-image.js +++ b/blocks/model-image/model-image.js @@ -107,7 +107,7 @@ export default function decorate(block) { }); pictureTagForZoom.addEventListener('click', (e) => { e.stopPropagation(); - addStyles(pictureTagForZoom.querySelector('img'), { 'max-width': 'unset' }); + addStyles(pictureTagForZoom.querySelector('img'), { 'max-width': 'unset', width: 'auto' }); }); block.querySelector('.button.icon-search').addEventListener('click', (e) => { e.stopPropagation();