esthor / react-native-swipeable-list

A zero-dependency Swipeable FlatList for React-Native, with Gestures, Quick Actions, and Animations. Simple as that.
MIT License
588 stars 31 forks source link

disable bounce #63

Closed baesumin closed 1 year ago

baesumin commented 1 year ago

Thanks for making a great library. Is it possible to stop scrolling beyond the required range or get rid of the bounce?

esthor commented 1 year ago

Glad you like the library!

Yep, if I'm understanding your wants, both of those things are possible and easy!

Set these props:

maxSwipeDistance - Maximum distance to open to after a swipe. Type number || (Object => number) shouldBounceOnMount (default = true) - To alert the user that swiping is possible, the first row can bounce on component mount. Type boolean

For the maxSwipeDistance, just set to the distance you want it to stop.

For shouldBounceOnMount just set it to false and it won't animate the initial bounce

baesumin commented 1 year ago

i mean, for example, even if maxSwipeDistance is set, while swiping, the swipe goes beyond the maxSwipeDistance and returns maxSwipeDistance when i release my hand.

It would be good if it does not swipe more than maxSwipeDistance during swipe.

esthor commented 1 year ago

Oh, you want it to clamp at the maxSwipeDistance.

Hmm, do you have any examples of apps doing this or a use case that can help me understand? I might be so used to iOS UX patterns that this seems "unnatural" to not be able to pull/"stretch" a swipe and have it "fling" back with a sense of "inertia".

baesumin commented 1 year ago

yes i want it to clamp at the maxSwipeDistance. 😃 It would be nice to have an option to use clamp.

github-actions[bot] commented 1 year ago

This issue has not had activity for 45 days. It will be closed in 10 days if there continues to be no activity.

brrradley commented 1 year ago

I agree, the bouncing isn't great. Items are also swipeable to the left a little. It would be great if it worked like Apple's Messages.

Sadly because of this i can't use your module and will have to keep looking.

github-actions[bot] commented 1 year ago

This issue has not had activity for 45 days. It will be closed in 10 days if there continues to be no activity.