-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
area-controls-collectionviewCollectionView, CarouselView, IndicatorViewCollectionView, CarouselView, IndicatorViewdelighter-scplatform/androids/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
When using item reordering in CollectionView (#3768) with a defined Header, I encounter an ArgumentOutOfRangeException when attempting to move an item to the last position of the list. This issue is not present when the Header is omitted.
System.ArgumentOutOfRangeException: 'Index was out of range. Must be non-negative and less than or equal to the size of the collection. (Parameter 'index')'
Steps to Reproduce
- Create default MAUI project
- Define a CollectionView with a Header and ItemTemplate to xaml file:
<CollectionView
x:Name="TestCollectionView"
CanReorderItems="True"
CanMixGroups="True">
<CollectionView.Header>
<Label Text="Header"/>
</CollectionView.Header>
<CollectionView.ItemTemplate>
<DataTemplate>
<Label Text="{Binding .}"/>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
- Populate ItemSource in xaml.cs file:
public TestCollectionViewPage()
{
InitializeComponent();
TestCollectionView.ItemsSource = new List<string>()
{
"Test label 1",
"Test label 2",
"Test label 3",
"Test label 4",
"Test label 5",
"Test label 6",
};
}
- Drag random Item from the middle to last position in the list
Link to public reproduction project repository
No response
Version with bug
7.0.96
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
No response
Metadata
Metadata
Assignees
Labels
area-controls-collectionviewCollectionView, CarouselView, IndicatorViewCollectionView, CarouselView, IndicatorViewdelighter-scplatform/androids/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