-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fixed crash in CollectionView on iOS when updating grouped data. #28133
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
|
Hey there @Dhivya-SF4094! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
jsuarezruiz
suggested changes
Mar 4, 2025
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28098.cs
Outdated
Show resolved
Hide resolved
2de0152 to
2f6f92b
Compare
rmarinho
approved these changes
Mar 12, 2025
Member
|
Does this happens on CV2 also? |
4ba5c27 to
e615b68
Compare
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Contributor
Author
@rmarinho Yes, this issue occurs in both CV1 and CV2. The provided fix resolves the issue in both. |
rmarinho
approved these changes
Mar 18, 2025
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area-controls-collectionview
CollectionView, CarouselView, IndicatorView
area-navigation
NavigationPage
community ✨
Community Contribution
p/0
Current heighest priority issues that we are targeting for a release.
partner/syncfusion
Issues / PR's with Syncfusion collaboration
platform/ios
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue Details
Updating grouped data in a hidden CollectionView can cause a crash on iOS and macOS.
Root Cause
The existing implementation of CollectionChanged() retrieves section and item counts from UICollectionView before processing collection changes such as Add, Remove, Replace, or Move. When an item is added to a new group or a group is deleted, the group count is updated within the Add/Remove methods. Since UICollectionView is not updated at this point, it results in inconsistencies in the internal data structure, leading to a crash when accessing sections.
Description of Change
To resolve this issue, updates to the CollectionView should be processed before and after querying its section and item counts. This ensures that UICollectionView correctly updates its internal state after retrieving section data, preventing inconsistencies and potential crashes.
This fixes the issue #28098 which is break
Validated the behaviour in the following platforms
Issues Fixed:
Fixes #28098
Fixes #27797
Screenshots
Video reference for #28098
28098_BeforeFix.mov
28098_AfterFix.mov
Video reference for #27797
27797_BeforeFix.mov
27797_AfterFix.mov