Skip to content

[iOS]Fix parent loss when CollectionView's ItemsSource changes at runtime #29551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

devanathan-vaithiyanathan
Copy link
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Root Cause

When updating the ItemsSource of a CollectionView using CollectionViewHandler2, template items lose their parent relationship.

Description of Change

Added check in TemplatedCell2.BindVirtualView to restore parent-child relationships for existing views that lost their parent reference during cell recycling in CollectionView. This fixes parent-based bindings when ItemsSource is updated.

Issues Fixed

Fixes #29491

Tested the behavior in the following platforms.

  • Android
  • Windows
  • iOS
  • Mac
Before After
iOS
Before_fix.mov
iOS
After_fix.mov

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label May 16, 2025
Copy link
Contributor

Hey there @@devanathan-vaithiyanathan! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label May 16, 2025
@jsuarezruiz jsuarezruiz added platform/iOS 🍎 area-controls-collectionview CollectionView, CarouselView, IndicatorView labels May 19, 2025
{
App.WaitForElement("Button");
App.Tap("Button");
VerifyScreenshot();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pending snapshot on Mac and Windows.

@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@devanathan-vaithiyanathan devanathan-vaithiyanathan marked this pull request as ready for review May 20, 2025 12:38
@devanathan-vaithiyanathan devanathan-vaithiyanathan requested a review from a team as a code owner May 20, 2025 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/iOS 🍎
Projects
None yet
2 participants