Skip to content

[Android] Fix CarouselView Issue23291 and Issue29216 test regression on candidate branch#34996

Merged
kubaflo merged 3 commits intodotnet:inflight/candidatefrom
praveenkumarkarunanithi:Fix-29544-Android
Apr 17, 2026
Merged

[Android] Fix CarouselView Issue23291 and Issue29216 test regression on candidate branch#34996
kubaflo merged 3 commits intodotnet:inflight/candidatefrom
praveenkumarkarunanithi:Fix-29544-Android

Conversation

@praveenkumarkarunanithi
Copy link
Copy Markdown
Contributor

@praveenkumarkarunanithi praveenkumarkarunanithi commented Apr 16, 2026

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

During CarouselView startup on Android, UpdateFromPosition runs before the carousel is fully initialized (_initialized = false). It sets _gotoPosition during an initial scroll attempt, but since the layout is not ready, the scroll never completes. This leaves _gotoPosition stuck at a non-negative value.

Earlier, this was unintentionally handled by an unconditional _gotoPosition = -1 in UpdateFromCurrentItem, which cleared the stale state. PR #34570 removed that line (to avoid breaking the guard during animations for #29544), exposing the issue.

As a result, _gotoPosition remains stuck, causing all subsequent UpdateFromPosition calls to fail the _gotoPosition == -1 check and skip scrolling. This leads to timeouts in tests like Issue23291 and Issue29216, as the carousel never moves to the requested position.

Description of Change

Updated the guard condition in UpdateFromPosition by applying the _initialized check only to the _gotoPosition assignment, ensuring it is set only after initialization while leaving the rest of the logic unaffected.
This prevents premature or stale _gotoPosition values during startup and preserves the existing scroll behavior, keeping the change safe.

Issues Fixed

Fixes regression introduced by #34570 :
Issue23291Test
Issue29216CarouselViewScrollingIssue on Candidate branch.

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Apr 16, 2026
@praveenkumarkarunanithi praveenkumarkarunanithi changed the title Update MauiCarouselRecyclerView.cs [Android] Fix Issue23291 and Issue29216 CarouselView test failures caused by _gotoPosition guard stuck during startup Apr 16, 2026
@praveenkumarkarunanithi praveenkumarkarunanithi added the area-controls-collectionview CollectionView, CarouselView, IndicatorView label Apr 16, 2026
@praveenkumarkarunanithi praveenkumarkarunanithi changed the title [Android] Fix Issue23291 and Issue29216 CarouselView test failures caused by _gotoPosition guard stuck during startup [Android] Fix CarouselView Issue23291 and Issue29216 test regression on candidate branch caused by #34570 Apr 16, 2026
@praveenkumarkarunanithi praveenkumarkarunanithi changed the title [Android] Fix CarouselView Issue23291 and Issue29216 test regression on candidate branch caused by #34570 [Android] Fix CarouselView Issue23291 and Issue29216 test regression on candidate branch Apr 16, 2026
@sheiksyedm sheiksyedm added the area-testing Unit tests, device tests label Apr 16, 2026
@sheiksyedm sheiksyedm marked this pull request as ready for review April 16, 2026 11:41
@sheiksyedm
Copy link
Copy Markdown
Contributor

/azp run maui-pr-uitests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@sheiksyedm
Copy link
Copy Markdown
Contributor

/azp run maui-pr-uitests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@kubaflo kubaflo merged commit 5057b14 into dotnet:inflight/candidate Apr 17, 2026
94 of 159 checks passed
@github-actions github-actions bot added this to the .NET 10 SR6 milestone Apr 17, 2026
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 area-testing Unit tests, device tests partner/syncfusion Issues / PR's with Syncfusion collaboration regressed-in-inflight/candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants