maui icon indicating copy to clipboard operation
maui copied to clipboard

System.IndexOutOfRangeException: IItemsViewSource is empty

Open LeoJHarris opened this issue 1 year ago • 3 comments

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 avatar Oct 17 '24 20:10 LeoJHarris

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

LeoJHarris avatar Oct 17 '24 20:10 LeoJHarris

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

Zhanglirong-Winnie avatar Oct 18 '24 09:10 Zhanglirong-Winnie

Hi @LeoJHarris. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

Duplicate of #25224

PureWeen avatar Oct 21 '24 17:10 PureWeen