Skip to content

[Android] Fix CarouselView Issue29216 test regression on candidate branch#35041

Merged
kubaflo merged 1 commit intodotnet:inflight/candidatefrom
praveenkumarkarunanithi:fix-29544-regression
Apr 21, 2026
Merged

[Android] Fix CarouselView Issue29216 test regression on candidate branch#35041
kubaflo merged 1 commit intodotnet:inflight/candidatefrom
praveenkumarkarunanithi:fix-29544-regression

Conversation

@praveenkumarkarunanithi
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

During CarouselView startup, UpdateFromPosition triggers an initial animated scroll to center the first item. In this flow, _gotoPosition is set, but CarouselViewScrolled exits early (!_initialized), so UpdatePosition never clears it. This leaves _gotoPosition stuck at 0, blocking subsequent programmatic scrolls.

When Position = 1 is later set (Issue29216), the guard condition (_gotoPosition == -1) fails, preventing the scroll.

Description of Change

Updated the animated scroll path to assign _gotoPosition only after initialization.
This aligns it with the non-animated fix - 34996, preserves startup centering behavior, and ensures _gotoPosition is set only when it can be properly cleared.

Issues Fixed

Fixes regression introduced by #34570 :
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 20, 2026
@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 2825e19 into dotnet:inflight/candidate Apr 21, 2026
149 of 159 checks passed
@github-actions github-actions Bot added this to the .NET 10 SR6 milestone Apr 21, 2026
Ahamed-Ali pushed a commit that referenced this pull request Apr 22, 2026
…ranch (#35041)

<!-- 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
During CarouselView startup, `UpdateFromPosition` triggers an initial
animated scroll to center the first item. In this flow, `_gotoPosition`
is set, but `CarouselViewScrolled` exits early (`!_initialized`), so
`UpdatePosition` never clears it. This leaves `_gotoPosition` stuck at
`0`, blocking subsequent programmatic scrolls.

When `Position = 1` is later set (Issue29216), the guard condition
(`_gotoPosition == -1`) fails, preventing the scroll.
 
### Description of Change
Updated the animated scroll path to assign `_gotoPosition` only after
initialization.
This aligns it with the non-animated fix -
[34996](#34996), preserves startup
centering behavior, and ensures `_gotoPosition` is set only when it can
be properly cleared.

### Issues Fixed
Fixes regression introduced by #34570 : 
`Issue29216CarouselViewScrollingIssue  on Candidate branch`.
 
Tested the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac
@PureWeen PureWeen modified the milestones: .NET 10 SR6, .NET 10 SR7 Apr 29, 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 platform/android regressed-in-inflight/candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants