-
-
Notifications
You must be signed in to change notification settings - Fork 333
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 |
me too I just copy and parse all code from example and try to do what bot say still happended |
Hey, I've released the v4. Could you try with the latest version and let me know what happened? |
I am having the same problem. My code is as follows.
remove fixedDirectionRemoving fixedDirection does not allow swiping to the right. RPReplay_Final1740747690.MP4fixedDirection="negative"If fixedDirection=“negative”, you can swipe to the right, but it does not move to the next card. RPReplay_Final1740747637.MP4 |
After giving this a lot of my time, my conclusion was that carousel-like component does not fit to the tinder like style for the main reason that tinder requires cards "stack" as opposed to carousel. For example if you would move the card on the top very far outside the screen the second card will start moving as well under the same gesture. My solution was eventually to implement my own cards stack with react animation style. actually it was not a lot of work. I've used the mix of the following tutorials: https://www.youtube.com/watch?v=m3KqkvqfI48&ab_channel=WilliamCandillon |
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: