osdnk / react-native-reanimated-bottom-sheet

Highly configurable bottom sheet component made with react-native-reanimated and react-native-gesture-handler
MIT License
3.33k stars 327 forks source link

overdragResistanceFactor set to 0 still allow to overdrag #86

Open DavoCg opened 5 years ago

DavoCg commented 5 years ago

Hello,

In the below example overdragResistanceFactor is set to 0, it's impossible to drag over 500 but it's still possible to drag under 160 and when it's released it bounces back to 160

Is it an expected behavior ?

let fall = new Animated.Value(1);

 <BottomSheet
        initialSnap={0}
        ref={bottomRef}
        enabledGestureInteraction={hasPlaylist}
        enabledInnerScrolling={false}
        callbackNode={fall}
        snapPoints={[
          160,
          500
        ]}
        renderContent={renderContent}
        renderHeader={renderHeader}
        overdragResistanceFactor={0}
      /> 

"react-native": "0.60.5" "reanimated-bottom-sheet": "^1.0.0-alpha.13"

Thanks for this great module !

sebqq commented 5 years ago

Same problem here. We should try to implement this behaviour using diffClamp for animated value.

sebqq commented 5 years ago

Hey @DavoCg. I've implemented bottomClamp flag for this package. If you would like to try please, feel free to install from my fork using:

yarn add https://github.com/sebinq/react-native-reanimated-bottom-sheet.git#e1ca6ede0d77b988cacde90e0e88b2b06090dc5b

command. Then, you need to set enabledBottomClamp prop to your bottom sheet to True. After that your BottomSheet should not jump below the most bottom snapPoint. Let me know if it is working for you and then I may raise a Pull Request with this feature.

Thanks!

anrogovskih commented 5 years ago

Hi @sebinq . I had the same problem and your fork made it work as expected. Thank you very much!

sebqq commented 5 years ago

PR #108 is already in master and published so everyone who wants to clamp BottomSheet from bottom should set enabledBottomClampproperty to true.