-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Description
When using a CollectionView where each item contains a CarouselView displaying a gallery of images, scrolling the CollectionView sometimes triggers a crash with the following exception:
System.IndexOutOfRangeException: 'Can't set CarouselView to position -1. ItemsSource has 3 items.'
If im doing something wrong please point that out
Steps to Reproduce
Steps to Reproduce:
Create a CollectionView with a complex ItemTemplate where each item contains a CarouselView showing images.
Set the CarouselView.ItemsSource to a small image collection (e.g., 3 images).
Scroll the CollectionView vertically.
Occasionally, the app crashes with the above exception.
Expected Behavior:
Scrolling the CollectionView should not cause CarouselView to attempt to set an invalid position. The CarouselView should handle item recycling safely and never set a position less than 0 or greater than ItemsSource.Count - 1.
Link to public reproduction project repository
https://github.com/Goncalo-Domingos/CollectionThrowsWithCarouselInside
Version with bug
9.0.100 SR10
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android, I was not able test on other platforms
Affected platform versions
Android 15 Emulator
Did you find any workaround?
Change the component entirely, install this nugget https://github.com/microspaze/CarouselView.Maui or create one of my own with the platform espefic components