[iOS] Fix Issue12574Test regression caused by early-exit guard in CollectionViewUpdating#34947
Merged
kubaflo merged 1 commit intoApr 14, 2026
Conversation
…m removal navigation
Contributor
|
Hey there @@SyedAbdulAzeemSF4852! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
kubaflo
approved these changes
Apr 14, 2026
Ahamed-Ali
pushed a commit
that referenced
this pull request
Apr 22, 2026
…lectionViewUpdating (#34947) <!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Root Cause - PR #32141 added an early-exit guard in CollectionViewUpdating that returned when currentItemPosition == -1, but -1 is the expected signal from GetIndexForItem indicating the current item was just removed — exiting early prevented GetPositionWhenRemovingItems from running, leaving _positionAfterUpdate stale. ### Description of Change - Removed the early-exit guard on currentItemPosition < 0 in CollectionViewUpdating in both CarouselViewController.cs and CarouselViewController2.cs, allowing the -1 value to flow through to GetPositionWhenRemovingItems which correctly interprets it as "the current item was removed" and calculates the right position to navigate to. ### Issues Fixed - Regression introduced by PR #32141 - **Resolved test case** : Issue12574Test UI Test ### Output | Before | After | |----------|----------| | <img src="https://github.com/user-attachments/assets/3542d8f6-c525-4e76-994d-500a3af892f2"> | <img src="https://github.com/user-attachments/assets/292649b3-d71d-46c7-ad79-6d09070bba03"> |
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
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
Description of Change
Issues Fixed
Output