-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
area-controls-collectionviewCollectionView, CarouselView, IndicatorViewCollectionView, CarouselView, IndicatorViewmigration-compatibilityXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-ConvertXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convertplatform/ioss/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
The KeepLastItemInView
doesn't seem to be working on iOS.
I have a bunch of items in a CollectionView
which gets its data from an ObservableCollection
in a view model. I then add a new item to ObservableCollection
but the CollectionView
doesn't display the newly added item. I have to manually scroll to see it.
This is happening in .NET 8 RC 2 but I observed the same behavior in .NET 7.
Here's the XAML:
...
<CollectionView
ItemsSource={Binding FeedItems}
ItemsUpdatingScrollMode="KeepLastItemInView">
...
</CollectionView>
And here's the view model:
public ObservableCollection<FeedItem> FeedItems { get; } = new();
[RelayCommand]
async Task AddItem(FeedItem newItem)
{
FeedItems.Insert(0, newItem);
}
Steps to Reproduce
- Add a
CollectionView
to aContentPage
- Create a corresponding ViewModel
- Create an
ObservableCollection
as demonstrated above - Bind the
CollectionView
toObservableCollection
as itsItemsSource
- Insert a new item to the
ObservableCollection
at index 0
Link to public reproduction project repository
No response
Version with bug
8.0.0-rc.2.9373
Is this a regression from previous behavior?
Yes, this used to work in Xamarin.Forms
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
No response
Did you find any workaround?
Haven't found a work around yet other than Clear();
the ObservableCollection
and add all the items -- including existing ones -- all over again.
Relevant log output
No response
SamuelJames101 and DDHSchmidt
Metadata
Metadata
Assignees
Labels
area-controls-collectionviewCollectionView, CarouselView, IndicatorViewCollectionView, CarouselView, IndicatorViewmigration-compatibilityXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-ConvertXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convertplatform/ioss/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