dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.06k stars 1.73k forks source link

System.IndexOutOfRangeException: IItemsViewSource is empty #25357

Open LeoJHarris opened 18 hours ago

LeoJHarris commented 18 hours ago

Description

iOS issue whereby the ItemsSource seems to be empty from the UI but I have added a few checks against empty ItemsSource from the MVVM when trying to access indexes of the ItemsSource. For the same source code Android never has the issue.

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

8.0.92 SR9.2

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

iOS 15

Did you find any workaround?

No

Relevant log output

System.IndexOutOfRangeException: IItemsViewSource is empty at Microsoft.Maui.Controls.Handlers.Items.EmptySource.get_Item(NSIndexPath indexPath) at Microsoft.Maui.Controls.Handlers.Items.ItemsViewController1[[Microsoft.Maui.Controls.ReorderableItemsView, Microsoft.Maui.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].UpdateTemplatedCell(TemplatedCell cell, NSIndexPath indexPath) at Microsoft.Maui.Controls.Handlers.Items.ItemsViewController1[[Microsoft.Maui.Controls.ReorderableItemsView, Microsoft.Maui.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].GetCell(UICollectionView collectionView, NSIndexPath indexPath) at UIKit.UIApplication.UIApplicationMain(Int32 argc, String[] argv, IntPtr principalClassName, IntPtr delegateClassName) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:line 61

LeoJHarris commented 18 hours ago

Seems to be similar to https://github.com/dotnet/maui/issues/11666

Zhanglirong-Winnie commented 4 hours ago

Could you provide us with a sample project so we can investigate it further? Looking forward to your reply!