-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
area-controls-collectionviewCollectionView, CarouselView, IndicatorViewCollectionView, CarouselView, IndicatorViewplatform/iosplatform/macosmacOS / Mac CatalystmacOS / Mac Catalysts/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working
Milestone
Description
Description
In an iOS and MacCatalyst, programmatically setting the SelectedItem property of a CollectionView to a valid item and then immediately setting theItemsSource property to null results in a crash (ObjCRuntime.ObjCException)
Steps to Reproduce
- Create a CollectionView in an iOS or MacCatalyst app with a valid ItemsSource.
- Programmatically set the SelectedItem to an item from the ItemsSource.
- Immediately set the ItemsSource to null.
- Observe the application crash.
Link to public reproduction project repository
Version with bug
9.0.70 SR7
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS, macOS
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
An unhandled exception of type 'ObjCRuntime.ObjCException' occurred in Microsoft.MacCatalyst.dll
at ObjCRuntime.Messaging.void_objc_msgSendSuper_NativeHandle_bool_UIntPtr(IntPtr receiver, IntPtr selector, NativeHandle arg1, Byte arg2, UIntPtr arg3)
at UIKit.UICollectionView.SelectItem(NSIndexPath indexPath, Boolean animated, UICollectionViewScrollPosition scrollPosition)
at Microsoft.Maui.Controls.Handlers.Items.SelectableItemsViewController`1.<>c__DisplayClass4_0.<SelectItem>b__0(Boolean _) inCopilot and EmilienDup
Metadata
Metadata
Assignees
Labels
area-controls-collectionviewCollectionView, CarouselView, IndicatorViewCollectionView, CarouselView, IndicatorViewplatform/iosplatform/macosmacOS / Mac CatalystmacOS / Mac Catalysts/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working