From b945c64af424b3a92e08c80c5422df43b7b19a85 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Tue, 3 Oct 2023 19:50:26 +0100 Subject: [PATCH] Add scrollEnabled --- src/view/com/lightbox/ImageViewing/index.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/view/com/lightbox/ImageViewing/index.tsx b/src/view/com/lightbox/ImageViewing/index.tsx index 78073fb079..77c4570165 100644 --- a/src/view/com/lightbox/ImageViewing/index.tsx +++ b/src/view/com/lightbox/ImageViewing/index.tsx @@ -77,6 +77,7 @@ function ImageViewing({ FooterComponent, }: Props) { const imageList = useRef>(null) + const [isScaled, setIsScaled] = useState(false) const [opacity, onRequestCloseEnhanced] = useRequestClose(onRequestClose) const [currentImageIndex, onScroll] = useImageIndexChange(imageIndex, SCREEN) const [headerTransform, footerTransform, toggleBarsVisible] = @@ -91,6 +92,7 @@ function ImageViewing({ const onZoom = useCallback( (isScaled: boolean) => { toggleBarsVisible(!isScaled) + setIsScaled(isScaled) }, [toggleBarsVisible], ) @@ -135,6 +137,7 @@ function ImageViewing({ data={images} horizontal pagingEnabled + scrollEnabled={!isScaled} showsHorizontalScrollIndicator={false} showsVerticalScrollIndicator={false} getItem={(_, index) => images[index]}