Open rysbilinski opened 1 week ago
I can repro this issue at iOS platform on the latest 17.13.0 Preview 1.0(9.0.10 & 9.0.0-preview.7.24407.4)The CVhandler2 was introduced in .NET 9.0, so it cannot be verified with NET8. I will keep the potential-regression lab for now, because users say it works on 8.0.100, which is confusing information to me. If you have any question, please feel free to contact us.
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