-
-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't swipe right in tinder example in docs #771
Comments
Hey @jony89! I'm here to help you with any bugs, questions, or contributions you have in mind. Let's tackle this together! To enable swiping right in the Tinder example from the <Carousel
loop={false}
style={{
width: PAGE_WIDTH,
height: PAGE_HEIGHT,
justifyContent: "center",
alignItems: "center",
}}
defaultIndex={0}
vertical={false}
width={PAGE_WIDTH}
height={PAGE_HEIGHT}
data={data}
onConfigurePanGesture={(g) => {
g.onChange((e) => {
"worklet";
directionAnimVal.value = Math.sign(e.translationX);
});
}}
// Remove or set fixedDirection to null to enable swiping right
fixedDirection={null}
renderItem={({ index, item }) => <Item key={index} img={item} />}
customAnimation={animationStyle}
windowSize={5}
/> This change will allow the carousel to support swiping in both directions [1]. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Nope changing the fixedDirection to undefined / null does not help |
@dosu the snap does not work when swiping right |
To address the issue with swiping right and the snapping not working, you might want to check the onConfigurePanGesture={(g) => {
"worklet";
g.enabled(true); // Ensure the gesture is enabled
g.onChange((e) => {
directionAnimVal.value = Math.sign(e.translationX);
});
}} Additionally, verify that the <Carousel
...
snapEnabled={true} // Ensure snapping is enabled
...
/> These adjustments should help in enabling the swipe right functionality and ensure that snapping works as expected [1][2]. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
@dosu this does not change a thing |
Ensure that the <Carousel
...
pagingEnabled={true} // Ensure paging is enabled
snapEnabled={true} // Ensure snapping is enabled
...
/> If the issue persists, verify that there are no other configurations or custom animations affecting the swipe direction or snapping behavior. Also, ensure that the To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
See the following tinder example of the latest docs:
https://rn-carousel.dev/Examples/custom-animations/tinder
Can't really swipe right. only left.
The text was updated successfully, but these errors were encountered: