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 328 forks source link

Slider not slide up when first component mounted #301

Open nwpnkmngm opened 3 years ago

nwpnkmngm commented 3 years ago

I have a problem with BottomSheet.

When after screen rendered, I try to swipe up Bottom sheet but it not slide up to snap at index 1 (for props snapPoints []). after I swiped first time it able to be slide up to top.

can anyone describe my issue ?

here my code

<BottomSheet ref={actionSheet} snapPoints={["12%", "85%"]} borderRadius={20} callbackNode={falling} enabledInnerScrolling enabledImperativeSnapping enabledBottomInitialAnimation renderContent={RenderOrderContent} /> <Animated.View style={{ alignItems: 'center', opacity: Animated.add(0.1, Animated.multiply(falling, 0.9)) }} />

const RenderOrderContent = () => { let style = { backgroundColor: colors.blackTransparent, width: "100%", height: "100%" } return (

{"SELECT SIZE"}
)

}

chefong commented 3 years ago

I just noticed this issue as well. On the first initial render, when I try swiping up, the sheet bounces back down to the initial snapping point. Then after I try swiping up again, it works

L42lo commented 3 years ago

I couldn't figure it why yet, but the issue is with the inner scrolling's pan gesture handler. Disabling fixes the issue, downside you can't scroll the content if needed. Adding a header helps, if you manage to initiate swipe on it.

MikeRayUX commented 3 years ago

Placing my component in the renderHeader prop instead of renderContent and leaving renderContent as a blank function solved this issue for me.

nwpnkmngm commented 3 years ago

@MichaelArriaga Thanks for solution , I will try it in your way.

Bur0 commented 3 years ago

@nwpnkmngm did you solve it ?

branaust commented 2 years ago

I too am having this exact issue.