-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
snapToItem(0, (animated = false)) snaps to SECOND item. #199
Comments
@rendomnet Can you share your exact |
|
@rendomnet This might have to do with the |
@bd-arc Yes. Turning off loop makes snapToItem act properly. But we need fix for loop=true settings. |
The issue should be fixed by this commit. To try it out, just copy/paste the following in your
@rendomnet Can you confirm that it works for you? |
Closing as no further feedback was provided. |
@bd-arc sorry my PC is not available rn so cant test your solution. I think it will work anyway, thank you for response. |
@bd-arc Potential bug: Have been using a looped carousel, and let's say I start at index one, I move to the left (index 0.. index (-1)..) the carousel suddenly loops around to that same card, but on the right side? Hard to explain, here's a gif: https://imgur.com/61cmLGJ |
Hi @jordangrant, Thanks for reporting back. While the issue you describe is not linked to the one from this thread, it clearly has to do with loop handling. When looping, the data you provide is cloned in order to create slide duplicates. When you reach the edges of the original slides, you are then scrolling duplicates (their number being defined by prop They are two potential problems though:
|
Honestly, I'm not completely satisfied with the "clones" approach, but that's the only one I could think of with the If you have a better idea, I'll be glad to implement it ;-) |
snaptoprev and snaptoItem(0) both are not working I want to slide back to the first item
Please help!!!! Here is how I'm creating my carousel
|
@AmmarTariq10 Please create a new thread that includes a Snack example in which the issue can be reproduced. Make sure to follow the contributing guidelines. |
for me |
Cant snap to first item.
this._carousel.snapToItem(0, (animated = true));
snaps to second one.And
this._carousel.snapToItem(1, (animated = true));
snaps to third one.The text was updated successfully, but these errors were encountered: