From c661aa96435b06d0d44792177afe6a83ad0e3d88 Mon Sep 17 00:00:00 2001 From: Wojciech Boman Date: Fri, 17 Nov 2023 13:40:01 +0100 Subject: [PATCH] Fix zoom images in AttachmentCarouselPage --- .../AttachmentCarousel/Pager/AttachmentCarouselPage.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/components/Attachments/AttachmentCarousel/Pager/AttachmentCarouselPage.js b/src/components/Attachments/AttachmentCarousel/Pager/AttachmentCarouselPage.js index 4f1beeb73684..87720e1c43a7 100644 --- a/src/components/Attachments/AttachmentCarousel/Pager/AttachmentCarouselPage.js +++ b/src/components/Attachments/AttachmentCarousel/Pager/AttachmentCarouselPage.js @@ -33,11 +33,6 @@ const defaultProps = { const DEFAULT_IMAGE_SIZE = 200; -const defaultImageStyle = { - width: DEFAULT_IMAGE_SIZE, - height: DEFAULT_IMAGE_SIZE, -}; - function AttachmentCarouselPage({source, isAuthTokenRequired, isActive: initialIsActive}) { const {canvasWidth, canvasHeight} = useContext(AttachmentCarouselPagerContext); @@ -87,7 +82,7 @@ function AttachmentCarouselPage({source, isAuthTokenRequired, isActive: initialI > { setIsImageLoading(true); @@ -173,7 +168,7 @@ function AttachmentCarouselPage({source, isAuthTokenRequired, isActive: initialI scaledImageHeight, }); }} - style={dimensions == null ? defaultImageStyle : {width: dimensions.scaledImageWidth, height: dimensions.scaledImageHeight}} + style={{width: dimensions?.scaledImageWidth || DEFAULT_IMAGE_SIZE, height: dimensions?.scaledImageHeight || DEFAULT_IMAGE_SIZE}} /> )}