From 2e343765c5285ab19f0633ed3a61a95c1b547c00 Mon Sep 17 00:00:00 2001 From: Yauheni Date: Thu, 13 Jun 2024 01:46:25 +0200 Subject: [PATCH] Reset image position when onSwipeDown is undefined --- src/components/ImageView/index.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/ImageView/index.tsx b/src/components/ImageView/index.tsx index 59212a6fd317..deb44048d47e 100644 --- a/src/components/ImageView/index.tsx +++ b/src/components/ImageView/index.tsx @@ -137,6 +137,9 @@ function ImageView({isAuthTokenRequired = false, url, fileName, onError, onSwipe if (dy >= maxTranslateY && scale.value === minScale) { if (onSwipeDown) { onSwipeDown(); + } else { + translationY.value = withSpring(0, SPRING_CONFIG); + translationX.value = withSpring(0, SPRING_CONFIG); } } else if (scale.value === minScale) { translationY.value = withSpring(0, SPRING_CONFIG);