CollectionViewHandler2 null reference exception if ItemsLayout is set for Tablet but NOT Phone #26065
Labels
area-controls-collectionview
CollectionView, CarouselView, IndicatorView
p/2
Work that is important, but is currently not scheduled for release
platform/iOS 🍎
potential-regression
This issue described a possible regression on a currently supported version., verification pending
t/bug
Something isn't working
Milestone
Description
Adding a collectionview to a page and only setting the ItemsLayout property for Tablet will throw a null reference exception before the page appears on mobile.
Steps to Reproduce
<CollectionView ItemsLayout="{OnIdiom Tablet='VerticalGrid 2'}" ItemsSource="{Binding Items}" VerticalOptions="Fill">
System.NullReferenceException: 'Object reference not set to an instance of an object.'
Link to public reproduction project repository
https://github.com/rysbilinski/CollectionViewHandler2Bugs
Version with bug
9.0.10 SR1
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
8.0.100 SR10
Affected platforms
iOS
Affected platform versions
No response
Did you find any workaround?
Workaround was to add the "phone" OnIdiom parameter:
<CollectionView ItemsLayout="{OnIdiom Phone='VeritcalGrid', Tablet='VerticalGrid 2'}" ItemsSource="{Binding Items}" VerticalOptions="Fill">
Relevant log output
The text was updated successfully, but these errors were encountered: