Open zahidalidev opened 3 weeks ago
Hey @zahidalidev! I'm here to help you with any bugs or questions you have in this repository. If you need assistance, feel free to ask.
The issue with the carouselRef.current.scrollTo
method causing the carousel to scroll back to the first index on Android was addressed in version 3.0.4 of react-native-reanimated-carousel
. The changelog for version 3.0.4 mentions a bug fix for this specific problem:
### Bug Fixes
- scrollTo is not running properly ([f406258](https://github.com/dohooo/react-native-reanimated-carousel/commit/f406258585e203a880ea82992c4ac79237f16df5)), closes [#222](https://github.com/dohooo/react-native-reanimated-carousel/issues/222)
Ensure you are using version 3.0.4 or later of the react-native-reanimated-carousel
package. If you are already using a version later than 3.0.4 and still experiencing the issue, it might be worth checking for any additional updates or patches that address similar problems [1].
To continue talking to Dosu, mention @dosu.
@dosu I also have a problem with scrollTo, but on web
@dosu I'm using version 3.4.0 and it's not working as expected.
@zahidalidev and @gavrilikhin-d, there is a known issue with the scrollTo
method on web platforms, which was addressed in version 3.0.4 of react-native-reanimated-carousel
. However, since you are using version 3.4.0 and still experiencing issues, it might be related to platform-specific differences or additional configurations required.
For web platforms, ensure you are using the correct parameters and configurations as outlined in the documentation. Here is an example of how to use the scrollTo
method:
ref.current?.scrollTo({ count: -1, animated: true });
Additionally, you can use the prev
and next
methods as alternatives:
ref.current?.prev({ animated: true });
ref.current?.next({ animated: true });
For more detailed examples and usage guidelines, you can refer to the documentation [1][2][3].
If the issue persists, consider checking for any updates or patches beyond version 3.4.0 that might address this problem.
To continue talking to Dosu, mention @dosu.
@dosu here are details of package versions and device that I'm using:
Versions:
Device:
It looks like you're using the correct versions of the packages, but you're still experiencing issues with the scrollTo
method on both iOS and Android. Here are a few suggestions to help resolve the problem:
Ensure Correct Usage: Make sure you are using the scrollTo
method correctly. Here is an example:
carouselRef.current?.scrollTo({
count: imageIndex,
animated: true,
});
Check for Updates: Although you are using version 3.4.0, it's always a good idea to check for any newer versions or patches that might address this issue.
Alternative Methods: If scrollTo
is not working as expected, you can try using the prev
and next
methods as alternatives:
carouselRef.current?.prev({ animated: true });
carouselRef.current?.next({ animated: true });
Platform-Specific Issues: Since the issue might be platform-specific, ensure that your configurations are correct for both iOS and Android. Sometimes, additional configurations or tweaks are required for different platforms.
Documentation and Examples: Refer to the official documentation and examples for more detailed usage guidelines:
If the issue persists after trying these suggestions, consider opening an issue on the repository with detailed information about your setup and the problem you're facing. This will help the maintainers investigate and provide a fix.
To continue talking to Dosu, mention @dosu.
I also have similar issues with scrollTo
method. I found that when there defaultScrollOffsetValue
prop is set I cannot use scrollTo({ index: ... }). Seems like Carousel scrolled somewhere out of scope and it displays just empty space instead of item.
Are there any limitations of using scrollTo and defaultScrollOffsetValue together?
I was able to get ref working by migrating to the alpha branch: https://github.com/dohooo/react-native-reanimated-carousel/tree/v4.0.0-alpha.12
Describe the bug The carouselRef.current.scrollTo method isn't functioning as expected. When used to scroll to a specific index, it briefly displays the correct image but then automatically scrolls back to the first index.
On iOS, combining carouselRef.current.scrollTo with a default index resolves this issue. However, on Android, although I can dynamically set the default index, this method does not allow for animated scrolling, which limits the experience.
To Reproduce Just configure the Carousel and try to scroll/change the image to a specific index.
Expected behavior Should scroll the image to a specific index.
Versions (please complete the following information):
Smartphone (please complete the following information):