Skip to content

[Mac][iOS] CollectionView does not shrink its rendered height after ItemsSource is updated with fewer items #38276

Description

@Monika4841

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

  1. Create a new .NET MAUI application.
  2. Add a CollectionView inside a Grid and place the Grid in a VerticalStackLayout.
  3. Subscribe to the CollectionView.SizeChanged event and display the control's height in a Label.
  4. Add a button that sets the CollectionView.ItemsSource to a collection containing more items.
  5. Add another button that replaces the CollectionView.ItemsSource with a collection containing only a fewer item.
  6. Launch the application on iOS or Mac Catalyst.
  7. Tap the button that loads more items into the CollectionView.
  8. Verify that the CollectionView expands and the displayed height value is updated.
  9. Tap the button that loads only a lesser item into the CollectionView.
  10. 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

Relevant log output

Activity

  1. added
    t/bug
    on Sep 7, 2026
  2. added
    platform/macos
    area-controls-collectionview
    on Sep 7, 2026
  3. HarishKumarSF4517 commented on Sep 7, 2026

    @HarishKumarSF4517
    Contributor

    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

    macOS(CV2) iOS(CV2)
    Screen.Recording.2026-09-07.at.5.24.16.PM.mov
    Screen.Recording.2026-09-07.at.5.20.51.PM.mov
    macOS(CV1) iOS(CV1)
    Screen.Recording.2026-09-07.at.5.47.00.PM.mov
    Screen.Recording.2026-09-07.at.5.45.09.PM.mov
  4. added
    s/verified
    s/triaged
    on Sep 7, 2026
  5. added
    partner/syncfusion
    on Sep 7, 2026
  6. added this to the .NET 10 SR12 milestone on Sep 11, 2026
  7. kubaflo commented on Oct 6, 2026

    @kubaflo
    Contributor

    /issue replicate --platform ios --branch main

  8. added a commit that references this issue on Oct 21, 2026
    abec789
  9. kubaflo commented on Oct 25, 2026

    @kubaflo
    Contributor

    Fixed here #38441

  10. 2 remaining items

  11. added a commit that references this issue on Oct 26, 2026
    e714988
  12. added a commit that references this issue on Oct 28, 2026
    7e1301f
  13. locked and limited conversation to collaborators on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-collectionviewcollectionview-cv2partner/syncfusionplatform/iosplatform/macoss/triageds/verifiedt/bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions