Skip to content

[iOS] CarouselViewHandler2 - NSInternalInconsistencyException thrown when setting ItemsSources #31339

@EmilienDup

Description

@EmilienDup

Description

On iOS, when using CarouselViewHandler2, trying to set the ItemsSource property with a collection containing multiple items throws an NSInternalInconsistencyException exception.

Usign CarouselViewHandler works well.

Tested with Maui.Control 9.0.100 and 9.0.110-ci.main.254, the exception thrown in both versions.

ObjCRuntime.ObjCException: Objective-C exception thrown.  Name: NSInternalInconsistencyException Reason: Attempted to scroll the collection view to an out-of-bounds item (20) when there are only 12 items in section 0. Collection view: <Microsoft_Maui_Controls_Handlers_Items_MauiCollectionView: 0x110850000; baseClass = UICollectionView; frame = (0 0; 390 719); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x1044393e0>; backgroundColor = UIExtendedGrayColorSpace 0 0; layer = <CALayer: 0x10fe90f80>; contentOffset: {3900, 0}; contentSize: {780, 0}; adjustedContentInset: {0, 0, 0, 0}; layout: <UICollectionViewCompositionalLayout: 0x1108a8000>; dataSource: <Microsoft_Maui_Controls_Handlers_Items2_CarouselViewController2: 0x10347bf80>>.

Steps to Reproduce

  1. Deploy the project available here
  2. Click on the Button

Link to public reproduction project repository

https://github.com/EmilienDup/MauiCarouselViewHandler2

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

iOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Labels

area-controls-collectionviewCollectionView, CarouselView, IndicatorViewcollectionview-cv2i/regressionThis issue described a confirmed regression on a currently supported versionp/0Current heighest priority issues that we are targeting for a release.partner/syncfusionIssues / PR's with Syncfusion collaborationplatform/ioss/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