react-native-awesome-gallery icon indicating copy to clipboard operation
react-native-awesome-gallery copied to clipboard

When zoomed in panning up and down triggers onSwipeToClose

Open EldinHb opened this issue 1 year ago • 3 comments

When zoomed in panning up and down triggers onSwipeToClose too quickly, because of this it is impossible to pan up and down. And when returning early in onSwipeToClose I can keep panning to what seems infinity in any direction.

Anyone else experiencing the same problem?

This is the code:

<View>
    <Gallery
         data={[img]}
         onSwipeToClose={() => router.back()}
         keyExtractor={x => x.thumb}
         renderItem={(item) => (
	         <Image
		         style={{
			objectFit: 'contain',
			flex: 1
		}}
		source={{
			uri: item.item.fullsize
		}}
	/>
     )}
/>
</View>

iOS 18.2 Expo 52 RN Gesture handler 2.20.2 Reanimate 3.16.1

EldinHb avatar Dec 20 '24 20:12 EldinHb

Yes, this is quite annoying behaviour. I believe the onSwipeToClose should never be triggered if scale > 1. Currently it's not triggered only if the scaled image's height exceeds the screen height.

  • scale = 1: can be swiped down to close
  • scale = 2: panning down will close gallery (this is incorrect)
  • scale = 3: won't close because now it exceeds the screen height
scale = 1 scale = 2 scale = 3
Image Image Image

kolking avatar Mar 07 '25 17:03 kolking

this seems to be fixed. What version are you using? @kolking

oeddyo avatar Apr 08 '25 02:04 oeddyo

@oeddyo the latest v0.4.2, I cannot confirm it's fixed.

kolking avatar Apr 08 '25 15:04 kolking