Skip to content

CollectionView does not update layout correctly when ItemsSource changes #30953

@APopatanasov

Description

@APopatanasov

Description

I have a page that contains a CollectionView. Based on some input, I update its ItemsSource. However, when the CollectionView is initially arranged with a height of zero, updating the ItemsSource and invalidating the measure still results in a measured height of zero.

This issue appears to be related to the switch from CollectionViewHandler to CollectionViewHandler2 as the default handler for iOS/Catalyst. When I revert to using the original CollectionViewHandler, the layout behaves as expected.

Steps to Reproduce

  1. Run the provided sample project.
  2. Type for example "G" in the entry.

Expected Behavior
The CollectionView should visualize a single item "Germany".

Actual Behavior
The CollectionView doesn't visualize any item and measure returns zero.

Link to public reproduction project repository

https://github.com/telerik/ms-samples/tree/main/Maui/CollectionViewItemsSourceNet10Issue

Version with bug

10.0.0-preview.6

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

9.0.90 SR9

Affected platforms

iOS, macOS

Affected platform versions

No response

Did you find any workaround?

If you switch back to CollectionViewHandler instead of using CollectionViewHandler2 everything is working as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-collectionviewCollectionView, CarouselView, IndicatorViewcollectionview-cv2i/regressionThis issue described a confirmed regression on a currently supported versionp/0Current heighest priority issues that we are targeting for a release.platform/iosplatform/macosmacOS / Mac Catalystregressed-in-10-preview1s/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions