Skip to content
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

autoPlayReverse not working. autoPlay does. #589

Open
joegoodall1 opened this issue Apr 16, 2024 · 2 comments
Open

autoPlayReverse not working. autoPlay does. #589

joegoodall1 opened this issue Apr 16, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@joegoodall1
Copy link

Describe the bug
autoPlayReverse not working. autoPlay does.

To Reproduce
Steps to reproduce the behavior:
Add basic arousel implementation and try and set autoPlayReverse prop

Expected behavior
Expect autoPlayReverse to work as autoPlay does (but in reverse).

Screenshots
If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

  • react: v18.2.0
  • react-native: v0.73.6
  • react-native-reanimated: v3.8.1
  • react-native-reanimated-carousel: v3.5.1
  • react-native-gesture-handler: v2.16.0

Smartphone (please complete the following information):

  • Device: iPhone15
  • OS: iOS17.4
@joegoodall1 joegoodall1 added the bug Something isn't working label Apr 16, 2024
Copy link

dosubot bot commented Apr 16, 2024

To address the issue with autoPlayReverse not working as expected in the react-native-reanimated-carousel, here are some steps and considerations:

  1. Verify autoPlayReverse Prop: Ensure that the autoPlayReverse prop is correctly set to true. This prop needs to be explicitly enabled to reverse the autoplay direction.

  2. Check carouselController Implementation: The functionality of autoPlayReverse depends on the prev method of the carouselController. Make sure that this method is correctly navigating to the previous item in the carousel.

  3. Component Re-rendering: Ensure that your component properly updates when the autoPlayReverse prop changes. Issues with component re-rendering or state management could prevent the expected behavior.

  4. Conflicting Code: Look for any other code or third-party libraries that might interfere with the carousel's operation. Conflicts or errors elsewhere could affect the autoplay functionality.

If after these checks the issue persists, providing more details about your implementation, especially how you're using the useAutoPlay hook and setting the autoPlayReverse prop, would be helpful. Additionally, any error messages or warnings you encounter would be useful for further diagnosis.

For implementation reference, you might want to review the useAutoPlay hook in the react-native-reanimated-carousel repository.

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@robertoganiani
Copy link

Setting both props at the same time works for me. So if you want reverse carousel you have to add autoPlayReverse prop
in addition to autoPlay, not replace it.
<Carousel autoPlay autoPlayReverse ... />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants