-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] CarouselView doesn't scroll to the right Position after changing the ItemSource with Loop enabled #17283
Description
Description
After the Carousel ItemSource is loaded for the first time, try to reset or assign a new ItemSource and set the Position to a specific value right after that with the Loop property enabled, the Carousel won't scroll to the right item. If we disable the Loop property, the scroll works fine. I could reproduce it on Android and iOS.
Steps to Reproduce
1 - Create a new project .NET MAUI App
2 - Add a Carousel to the page with the Loop = True
3 - Load a list of 3+ items into the Carousel ItemSource
4 - Swipe it to the last position
5 - Replace the item source list or assign a new one. It could be the same list, but it needs to reset the ItemSource.
6 - Try to set the position again to the last item programmatically right after reloading the list.
7 - If you disable the loop it works.
Expected outcome: The last item should be selected
Actual outcome: The first item will be selected, and the swipe feature will get lost
Link to public reproduction project repository
https://github.com/l0gaw/CarouselPositionLoopIssue
Version with bug
7.0.92
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android
Affected platform versions
Android 13 and iOS 16.6
Did you find any workaround?
Disable the Loop property.
Relevant log output
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status