pavelbabenko / react-native-awesome-gallery

Performant, native-like, and well-customizable gallery for React Native.
MIT License
495 stars 54 forks source link

feat: Adding `disableSwipeUp` to disable swiping up when scale == 1 #31

Closed mtflud closed 3 years ago

mtflud commented 3 years ago

First of all, thank you for this awesome library! We're using this at the company I'm working for, and we're presenting the gallery using a modal presentation from react-native-navigation, which animates presentation from bottom to top, and dismissal from top to bottom.

We want to be able to dismiss the gallery by swiping down, and do that by invoking navigation.goBack() from onSwipeToClose. This works great since the modal itself animates on the same direction while closing, but looks very weird when dismissing it by swiping up (photo goes up while modal goes down).

This PR introduces a disableSwipeUp prop, that disables swiping up when there's no scale.

pavelbabenko commented 3 years ago

@mtflud Thank you for your PR! It's released in v0.2.6

mtflud commented 3 years ago

@pavelbabenko Thank you for the quick turnaround! Keep up the awesome work