From 94c77f3869f3f796cfb6065cf5cea715ff454fbd Mon Sep 17 00:00:00 2001 From: Maxim Bolshakov Date: Sun, 17 May 2020 14:34:23 +0200 Subject: [PATCH] Android: Close modal on vertical paging (#46) --- src/components/ImageItem/ImageItem.android.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/ImageItem/ImageItem.android.tsx b/src/components/ImageItem/ImageItem.android.tsx index 4601b78..6732e4a 100644 --- a/src/components/ImageItem/ImageItem.android.tsx +++ b/src/components/ImageItem/ImageItem.android.tsx @@ -96,8 +96,9 @@ const ImageItem = ({ const offsetY = nativeEvent?.contentOffset?.y ?? 0; if ( - Math.abs(velocityY) > SWIPE_CLOSE_VELOCITY && - offsetY > SWIPE_CLOSE_OFFSET + (Math.abs(velocityY) > SWIPE_CLOSE_VELOCITY && + offsetY > SWIPE_CLOSE_OFFSET) || + offsetY > SCREEN_HEIGHT / 2 ) { onRequestClose(); }