Skip to content

[iOS] Fix Issue12574Test regression caused by early-exit guard in CollectionViewUpdating#34947

Merged
kubaflo merged 1 commit into
dotnet:inflight/candidatefrom
SyedAbdulAzeemSF4852:fix/issue-12574-failure
Apr 14, 2026
Merged

[iOS] Fix Issue12574Test regression caused by early-exit guard in CollectionViewUpdating#34947
kubaflo merged 1 commit into
dotnet:inflight/candidatefrom
SyedAbdulAzeemSF4852:fix/issue-12574-failure

Conversation

@SyedAbdulAzeemSF4852

Copy link
Copy Markdown
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

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

Output

Before After

@dotnet-policy-service dotnet-policy-service Bot added the community ✨ Community Contribution label Apr 14, 2026
@dotnet-policy-service

Copy link
Copy Markdown
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.

@dotnet-policy-service dotnet-policy-service Bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Apr 14, 2026
@sheiksyedm sheiksyedm marked this pull request as ready for review April 14, 2026 09:47
@sheiksyedm sheiksyedm added the area-controls-collectionview CollectionView, CarouselView, IndicatorView label Apr 14, 2026
@sheiksyedm sheiksyedm added this to the .NET 10 SR7 milestone Apr 14, 2026
@sheiksyedm sheiksyedm requested a review from kubaflo April 14, 2026 09:48
@kubaflo kubaflo merged commit fa081dc into dotnet:inflight/candidate Apr 14, 2026
2 of 12 checks passed
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">
|
@github-actions github-actions Bot locked and limited conversation to collaborators May 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-collectionview CollectionView, CarouselView, IndicatorView community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants