Repository navigation
Description
Description
On Mac and ios, when a CollectionView is initially populated with a larger number of items, it expands and reports a larger rendered height through the SizeChanged event. If the ItemsSource is subsequently updated with a smaller number of items, the CollectionView continues to retain the previously measured height instead of recalculating and shrinking to match the new content size.
As a result, the height displayed through the SizeChanged event and the Height property remains unchanged after reducing the item count.
Kindly check the sample below for the issue replication:
Sample.zip
Steps to Reproduce
- Create a new .NET MAUI application.
- Add a CollectionView inside a Grid and place the Grid in a VerticalStackLayout.
- Subscribe to the CollectionView.SizeChanged event and display the control's height in a Label.
- Add a button that sets the CollectionView.ItemsSource to a collection containing more items.
- Add another button that replaces the CollectionView.ItemsSource with a collection containing only a fewer item.
- Launch the application on iOS or Mac Catalyst.
- Tap the button that loads more items into the CollectionView.
- Verify that the CollectionView expands and the displayed height value is updated.
- Tap the button that loads only a lesser item into the CollectionView.
- Observe that the CollectionView does not shrink to match the reduced content and continues to report the previously measured height.
Expected behavior:
The CollectionView should invalidate its layout, remeasure its content, and update its height to match the current item count when the ItemsSource is replaced with a smaller collection.
Link to public reproduction project repository
No response
Version with bug
10.0.100
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
macOS, iOS
Affected platform versions
No response
Did you find any workaround?
No response
Activity
HarishKumarSF4517 commentedon Sep 7, 2026
This issue has been validated in Visual Studio Code 1.135.0 with .NET MAUI versions 10.0.00 and 10.0.100. It can be reproduced on iOS and macOS platform. I have attached the output below:
Note: This issue occurs only on CV2
Output Screenshot
Screen.Recording.2026-09-07.at.5.24.16.PM.mov
Screen.Recording.2026-09-07.at.5.20.51.PM.mov
Screen.Recording.2026-09-07.at.5.47.00.PM.mov
Screen.Recording.2026-09-07.at.5.45.09.PM.mov
kubaflo commentedon Oct 6, 2026
/issue replicate --platform ios --branch main
[iOS/Mac] Fix CollectionView2 height not updating when ItemsSource ch…
kubaflo commentedon Oct 25, 2026
Fixed here #38441
2 remaining items
[iOS/Mac] Fix CollectionView2 height not updating when ItemsSource ch…
[iOS/Mac] Fix CollectionView2 height not updating when ItemsSource ch…
[iOS/Mac] Fix CollectionView height shrinking without regressing nest…
[iOS/Mac] Fix CollectionView height shrinking without regressing nest…
[iOS/Mac] Fix CollectionView height shrinking without regressing nest…
[iOS/Mac] Fix CollectionView height shrinking without regressing nest…
[iOS/Mac] Fix CollectionView height shrinking without regressing nest…
[iOS/Mac] Fix CollectionView height shrinking without regressing nest…
[iOS/Mac] Fix CollectionView height shrinking without regressing nest…
[iOS/Mac] Fix CollectionView height shrinking without regressing nest…
[iOS/Mac] Fix CollectionView height shrinking without regressing nest…
[iOS/Mac] Fix CollectionView height shrinking without regressing nest…
[iOS/Mac] Fix CollectionView height shrinking without regressing nest…
[iOS/Mac] Fix CollectionView height shrinking without regressing nest…