Skip to content

[Android] CarouselView doesn't scroll to the right Position after changing the ItemSource with Loop enabled #17283

@l0gaw

Description

@l0gaw

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

area-controls-collectionviewCollectionView, CarouselView, IndicatorViewfixed-in-8.0.90fixed-in-9.0.0-rc.2.24503.2p/1Work that is important, and has been scheduled for release in this or an upcoming sprintpartner/syncfusionIssues / PR's with Syncfusion collaborationplatform/androids/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions