Repository navigation
[iOS] Fix vertical CarouselView Position synchronization - #39377
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 39377Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 39377" |
|
Hey there @@SubhikshaSf4851! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
This comment has been minimized.
This comment has been minimized.
|
Note 🔍
|
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
🟡 Changes recommended
The regression test uses programmatic ScrollTo instead of reproducing the reported native swipe path.
1 open finding
What changed in this PR
Fixes vertical CarouselView position synchronization on iOS by calculating page offsets using the active scroll-axis dimension.
Changes:
- Uses container height for vertical page calculations.
- Adds a HostApp regression scenario.
- Adds UI assertions for
PositionandPositionChanged.
| File | Description |
|---|---|
LayoutFactory2.cs |
Calculates effective item size from the active axis. |
Issue39371.cs (HostApp) |
Adds the vertical CarouselView test page. |
Issue39371.cs (UI test) |
Validates position synchronization after scrolling. |
🧠 Review effort: Balanced
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 1 findings
See inline comments for details.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
<!-- 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! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Description of Change <!-- Enter description of the fix in this section --> Add a dedicated issue-comment workflow that minimizes standalone `/azp run` commands, including named-pipeline variants, and success-only acknowledgments from `azure-pipelines[bot]` as resolved on MAUI pull requests. Comments remain expandable. Failures, authorization notices, mixed success/warning responses, and ordinary discussion remain visible. The workflow re-reads comments before classification, checks out no PR code, and does not change pipeline dispatch or authorization. Document the behavior and activation boundary: after merging into the default branch, cleanup applies to newly created or edited comments, not historical comments. Validation: - `actionlint .github/workflows/azure-pipelines-comment-cleanup.yml` — passed. - `git diff --check` — passed. - Embedded workflow JavaScript syntax check using Node.js `AsyncFunction` — passed. - Live GitHub Actions execution was not run; the new `issue_comment` workflow requires the default branch to contain it. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> No linked issue. Addresses comment noise exemplified by #39377 (comment); does not modify that PR's product code. <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9da04e32-247a-4969-b4a9-05e872b0763d
Tests Failure Analysis
🧪 CI Analysis — click to expand📊 maui-prNo failures found. 🧪 maui-pr-devicetests
🧪 maui-pr-uitests
🧭 Follow-up — actions and refreshNext action: Restore complete UI evidence; inspect the Android crash and compare unresolved cases with identical runtime/setup.
|
There was a problem hiding this comment.
Expert Review — 0 findings
Reviewed commit ec0afe7.
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 1 findings
See inline comments for details.
|
|
||
| [Test] | ||
| [Category(UITestCategories.CarouselView)] | ||
| public void ScrollToUpdatesPositionAndRaisesPositionChanged() |
There was a problem hiding this comment.
🔍 AI-Generated Review (multi-model)
[moderate] Regression Prevention and Test Coverage — The regression test validates only the programmatic ScrollTo path (App.Tap("ScrollToNextButton")) instead of reproducing the reported native vertical swipe scenario. Concrete failure mode: a future iOS Items2 change can break gesture-driven Position/PositionChanged updates while this test remains green because button-triggered ScrollTo still updates the labels.
MauiBot
left a comment
There was a problem hiding this comment.
AI Review Summary
@SubhikshaSf4851 — new AI review results are available based on commit
ec0afe7.
🗂️ Review Sessions — click to expand
🚦 Gate — Test Before & After Fix
Gate Result: ✅ PASSED
Platform: IOS · Base: main · Merge base: 51cf98f2
| Test | Without Fix (expect FAIL) | With Fix (expect PASS) |
|---|---|---|
🖥️ Issue39371 Issue39371 |
✅ FAIL — 441s | ✅ PASS — 128s |
🔴 Without fix — 🖥️ Issue39371: FAIL ✅ · 441s
Error-relevant lines (filtered from the build log):
at Microsoft.Maui.TestCases.Tests.Issues.Issue39371.<ScrollToUpdatesPositionAndRaisesPositionChanged>b__3_0() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue39371.cs:line 26
at UITest.Appium.HelperExtensions.RetryAssert(IApp app, Action assertToRetry, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 998
at Microsoft.Maui.TestCases.Tests.Issues.Issue39371.ScrollToUpdatesPositionAndRaisesPositionChanged() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue39371.cs:line 24
🟢 With fix — 🖥️ Issue39371: PASS ✅ · 128s
(no coded error found; showing last 1200 chars)
t...
A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.13)
[xUnit.net 00:00:00.07] Discovering: Controls.TestCases.iOS.Tests
[xUnit.net 00:00:00.21] Discovered: Controls.TestCases.iOS.Tests
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in /Users/cloudtest/vss/_work/1/s/artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net10.0/Controls.TestCases.iOS.Tests.dll
NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 10/15/2026 5:50:25 AM FixtureSetup for Issue39371(iOS)
>>>>> 10/15/2026 5:50:34 AM ScrollToUpdatesPositionAndRaisesPositionChanged Start
>>>>> 10/15/2026 5:50:35 AM ScrollToUpdatesPositionAndRaisesPositionChanged Stop
Passed ScrollToUpdatesPositionAndRaisesPositionChanged [1 s]
NUnit Adapter 4.5.0.0: Test execution complete
Results File: /Users/cloudtest/vss/_work/1/s/CustomAgentLogsTmp/UITests/TestResults/Issue39371.trx
Test Run Successful.
Total tests: 1
Passed: 1
Total time: 32.7208 Seconds
>>> TRX_RESULT_FILE: /Users/cloudtest/vss/_work/1/s/CustomAgentLogsTmp/UITests/TestResults/Issue39371.trx
📁 Fix files reverted (1 files)
src/Controls/src/Core/Handlers/Items2/iOS/LayoutFactory2.cs
📋 Pre-Flight — Context & Validation
Pre-Flight Context
Reported problem
PR #39377 targets #39371. The issue reports that an iOS CollectionView 2 CarouselView configured vertically with Loop="False", MandatorySingle snap points, and centered alignment visually scrolls and snaps after a native swipe, but:
CarouselView.Positionremains stale.PositionChangedis not raised.- The equivalent horizontal configuration works.
The report identifies .NET MAUI 10.0.110; a follow-up states reproduction on 10.0.0 and 10.0.110 and says the issue was not reproduced with CollectionView 1. The affected iOS version, regression origin, and last known working MAUI version are unknown.
Submitted change
The immutable diff contains three files:
| File | Purpose |
|---|---|
src/Controls/src/Core/Handlers/Items2/iOS/LayoutFactory2.cs |
Corrects page-size calculation in the iOS CollectionView 2 carousel layout callback. |
src/Controls/tests/TestCases.HostApp/Issues/Issue39371.cs |
Adds a vertical, two-item reproduction page with observable Position and PositionChanged labels. |
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue39371.cs |
Adds an Appium regression test that programmatically scrolls to item 1 and checks both labels. |
The production code is inside NSCollectionLayoutSection.VisibleItemsInvalidationHandler. Before the change, the callback selected offset.X or offset.Y according to orientation but always divided that offset by a size derived from the container width. The patch instead chooses the container dimension on the active axis:
- Horizontal:
offset.Xand container width. - Vertical:
offset.Yand container height.
It then subtracts the section margins, adds ItemSpacing, and derives the page index from that effective item size. The existing callback returns without updating state when the calculated page is not effectively an integer, the item source is empty, the controller is updating, or rotation is in progress.
When a page is accepted, the existing CarouselViewController2.SetPosition path:
- Resolves any pending programmatic
_gotoPosition. - Sets
CarouselView.PositionPropertythroughSetValueFromRenderer. - Updates
CurrentItem. - Updates visual states.
CarouselViewDelegator2 separately tracks scrolling, dragging, animation completion, and deceleration; it does not itself assign Position. Position synchronization therefore depends on the layout invalidation callback reaching SetPosition.
Regression test path
The new host page uses:
- A vertical
CarouselViewwith a 300-point height. - Two items.
Loop = false.MandatorySingleand centered snap alignment.- A button that calls
ScrollTo(1, Center, animate: false). - Labels updated from
PositionChanged.
The UI test taps that button and retries until both labels report position 1. This is a programmatic ScrollTo path, while the issue’s documented reproduction uses a native vertical swipe.
Two resolved review threads recorded this distinction. The contributor replied that ScrollTo also reproduces the defect. The supplied Gate result provides concrete evidence that the submitted test fails without the production fix and passes with it, but it does not by itself establish native-gesture coverage. Existing test Issue33308 demonstrates the repository’s gesture approach using App.ScrollDown(..., ScrollStrategy.Gesture, ...).
Platform-sensitive paths
- The production change is under
Handlers/Items2/iOS; it does not modify CollectionView 1. - The vertical and horizontal paths share this callback. Horizontal behavior still selects width, while vertical behavior changes to height.
ItemSpacing, section/peek margins, looping correction, pending programmatic positions, and rotation guards all interact with the page calculation.- The reported configuration has
Loop = false, although the callback also serves looping carousels. - Required testing platform: iOS.
- The host issue is marked
PlatformAffected.iOS, and the PR description records only iOS as tested. - Whether this source is also compiled or behaviorally affected on Mac Catalyst was not established from the gathered context.
Validation context and requirements
Available evidence:
- Gate: passed — the regression test fails without the fix and passes with it. It must not be rerun for this experiment.
- The issue was independently marked reproduced on iOS with CollectionView 2.
- The PR description claims before/after iOS testing and links videos; those attachments were not independently evaluated here.
- CI pipelines were requested in PR comments, but their final results are unknown from the gathered context.
Relevant behavior for later iOS validation includes:
- Vertical native swipe and snap update
Positionand raisePositionChanged. - Programmatic non-animated
ScrollToreaches the same managed state. - Horizontal synchronization remains unchanged.
- Visual snapping remains correct while managed state updates.
- Non-square containers exercise the corrected width-versus-height distinction.
- Item spacing and peek/section margins continue to produce integral page calculations.
- Looping, rotation, and
CurrentItembehavior are adjacent paths, though not part of the reportedLoop=falsescenario.
Remaining uncertainties
- Native swipe behavior is not directly exercised by the submitted regression test.
- The exact affected iOS versions and whether Mac Catalyst is affected are unknown.
- Regression status and the last known working MAUI release are unknown.
- Coverage of spacing, peek areas, looping, rotation, animated scrolling, and differing item/container dimensions is not shown.
- The precise handler-selection configuration used by the test infrastructure was not inspected; the supplied Gate result nevertheless demonstrates that this test distinguishes the submitted production change.
- Full CI, device-test, and deep-UI-test outcomes are unknown.
- PR #39377 remains open against
main(f16eb7980531458370d47585f94719ad74e45708) with submitted headec0afe7a832d78ee623242512da8747354d743f3. Its blocked merge state is metadata only and is not a merge-readiness conclusion.
This is scoped pre-flight context, not an exhaustive code review or comparative recommendation.
🔬 Code Review — Deep Analysis
Code Review — PR #39377
Independent Assessment
What this changes: The iOS/MacCatalyst Items2 carousel layout callback now divides the active-axis scroll offset by the active-axis container size. Horizontal carousels continue to use width; vertical carousels use height. The PR also adds an iOS UI-test page and an Appium test that invokes non-animated ScrollTo(1) and observes Position and PositionChanged.
Inferred motivation: A non-square vertical carousel previously combined offset.Y with container width, producing a fractional page that was rejected before CarouselViewController2.SetPosition could synchronize managed state.
Reconciliation with Submitted Context
The production change matches the reported width-versus-height root cause, stays in the active iOS/MacCatalyst Items2 handler, and leaves the horizontal calculation unchanged. The trusted Gate establishes that the submitted programmatic-scroll test fails without the production change and passes with it. It does not establish that the test exercises the reported native-swipe interaction.
Findings
❌ Error — Regression test does not reproduce the reported native vertical swipe
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue39371.cs:19 taps a button whose handler calls ScrollTo(1, Center, animate: false). The issue scenario is a user swipe followed by native snapping. Those paths converge on some of the same position code, but they are not equivalent regression coverage: gesture/deceleration or snap integration can regress while programmatic ScrollTo remains green. The test should drive the vertical carousel with the repository's gesture scroll API and assert that both Position and PositionChanged reach 1.
Blast Radius Assessment
- Runs for all instances: the changed invalidation callback serves all CarouselView instances using the iOS/MacCatalyst Items2 compositional layout; the changed dimension is selected only by orientation.
- Startup impact: none.
- Static/shared state: none.
- Adjacent behavior: horizontal paging, vertical spacing and peek margins, loop correction, rotation guards,
CurrentItem, and both programmatic and gesture-driven scrolling share this callback.
Failure-Mode Probing
- Non-square vertical container: the corrected calculation uses height for both the vertical offset scale and effective item size, allowing an integral page to reach
SetPosition. - Horizontal carousel: the calculation still uses width and preserves the prior behavior.
- Native gesture versus programmatic scroll: the submitted test covers only programmatic scrolling, leaving the original gesture/deceleration path unprotected.
- Empty or invalid geometry: existing item-count and non-positive-size guards remain in place.
External Output Contract
Not applicable.
Verdict: NEEDS_CHANGES
Confidence: medium
Summary: The production correction is localized and mechanically consistent with the active scroll axis, and Gate evidence validates the programmatic path. The regression test does not reproduce the issue's native-swipe scenario, so the submitted PR still lacks direct protection for the behavior it claims to fix.
🛠️ Try-Fix — Analysis & Comparison
Alternative generation: not requested
Evidence-first mode intentionally omits routine Try-Fix attempts. This is not a failed
attempt, a completed alternative search, or evidence that alternatives have no value.
The expert review may still produce one evidence-backed PR refinement.
🏁 Report — Final Recommendation
⚠️ Final Recommendation: REQUEST CHANGES
Phase Status
| Phase | Status | Notes |
|---|---|---|
| Pre-Flight | ✅ COMPLETE | Trusted evidence-first context consumed |
| Expert Code Review | NEEDS_CHANGES (medium) | 1 blocking test-coverage finding |
| Gate | ✅ PASSED | iOS; submitted test fails without the production fix and passes with it |
| Try-Fix | NOT REQUESTED | Evidence-first mode intentionally omitted alternative generation |
| Refinement | ✅ PASSED | One evidence-backed pr-plus-reviewer refinement; focused iOS UI test passed |
| Report | ✅ COMPLETE | Compared the two real candidates only |
Code Review and Candidate Comparison
| Candidate | Production fix | Regression evidence | Expert finding | Rank |
|---|---|---|---|---|
pr |
Corrects vertical page-size calculation while preserving the horizontal width path | Trusted Gate passed for programmatic ScrollTo |
Unresolved: test does not reproduce the reported native swipe | 2 |
pr-plus-reviewer |
Same submitted production fix | Native gesture test passed on iOS in the isolated candidate worktree | Addressed by driving ScrollStrategy.Gesture and retaining the Position/PositionChanged assertions |
1 |
Selected Fix: pr-plus-reviewer. It is the only candidate that directly exercises the reported native-swipe path, and its one permitted focused validation passed. The submitted PR still requires that test refinement, so approval is vetoed even though the production correction and trusted Gate evidence are sound.
The trusted Gate was not rerun, as required. Consequently, the refined gesture test was validated with the fix but was not separately executed against the broken baseline; this remaining evidence limitation is recorded rather than treated as a pass.
Summary
The submitted axis-size correction is localized, uses height for vertical scrolling and width for horizontal scrolling, and reaches the existing SetPosition synchronization path. Expert review found no production-code defect, but it found that the submitted UI test uses programmatic scrolling instead of the issue's native gesture. The validated refinement corrects that mismatch.
Root Cause
The iOS/MacCatalyst Items2 layout callback used offset.Y for a vertical carousel but divided it by an effective size derived from container width. In a non-square container this yielded a fractional page, causing the callback to return before updating Position and raising PositionChanged.
Fix Quality
The production change is small, axis-consistent, and preserves existing guards for invalid geometry, empty sources, updates, and rotation. The refined test uses the repository's established gesture-scroll API and verifies both managed-state signals after native snapping. Because this improvement is not present in submitted PR HEAD, the PR requires changes.
📱 UI Tests — CarouselView,CollectionView
Detected UI test categories: CarouselView,CollectionView
✅ Deep UI tests — 532 passed, 0 failed, 9 skipped across 2 categories on platform-pool agent (replaces in-process counts above).
🧪 UI Test Execution Results (deep, platform pool)
| Category | Tests | Snapshot diffs |
|---|---|---|
CarouselView |
101/105 (4 skipped) ✓ | — |
CollectionView |
431/436 (5 skipped) ✓ | — |
📎 Download drop-deep-uitests artifact (TRX + snapshot diffs) |
🧭 Next Steps — reviewer changes required
The reviewer-enhanced candidate identified changes that are not yet in the submitted PR.
Why: The submitted production fix is sound, but its test does not reproduce the reported native-swipe path. The pr-plus-reviewer refinement directly exercises that gesture and passed the isolated focused iOS validation, so it is the stronger candidate and must be incorporated into the PR.
Address the actionable findings in this review before merging.
<!-- 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 In iOS `CarouselView` vertical scroll, the native scroll offset was divided by the container `width` instead of its `height`. This produced a fractional page value, preventing `SetPosition` from updating `Position` and raising `PositionChanged` after manual scrolling. #### Description of change A shared `containerSize` value is used that selects the appropriate container dimension for the active scroll axis: - horizontal CarouselView: `offset.X` and container width; - vertical CarouselView: `offset.Y` and container height. The effective item size now derives from `containerSize`, allowing a vertically snapped item to resolve to its correct integer page and update `Position` through the existing `SetPosition` path. <!-- Enter description of the fix in this section --> ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #39371 ### Tested the behavior in the following platforms - [ ] Windows - [ ] Android - [x] iOS - [ ] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <video src="https://github.com/user-attachments/assets/35aaca5b-28d4-4f6b-ba7d-c91c287c546a"> | <video src="https://github.com/user-attachments/assets/4cd53a07-4c3e-4a76-9f12-dbea49d075da"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
<!-- 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 In iOS `CarouselView` vertical scroll, the native scroll offset was divided by the container `width` instead of its `height`. This produced a fractional page value, preventing `SetPosition` from updating `Position` and raising `PositionChanged` after manual scrolling. #### Description of change A shared `containerSize` value is used that selects the appropriate container dimension for the active scroll axis: - horizontal CarouselView: `offset.X` and container width; - vertical CarouselView: `offset.Y` and container height. The effective item size now derives from `containerSize`, allowing a vertically snapped item to resolve to its correct integer page and update `Position` through the existing `SetPosition` path. <!-- Enter description of the fix in this section --> ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #39371 ### Tested the behavior in the following platforms - [ ] Windows - [ ] Android - [x] iOS - [ ] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <video src="https://github.com/user-attachments/assets/35aaca5b-28d4-4f6b-ba7d-c91c287c546a"> | <video src="https://github.com/user-attachments/assets/4cd53a07-4c3e-4a76-9f12-dbea49d075da"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
|
It will be in sr1 net11 |
|
Hi @kubaflo & Team, thanks a lot for the fix! Could you confirm whether it will also ship in a .NET 10 service release (e.g. 10.0.130)? |
|
@Kapusch yea, I will include it in sr13 |
<!-- 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 In iOS `CarouselView` vertical scroll, the native scroll offset was divided by the container `width` instead of its `height`. This produced a fractional page value, preventing `SetPosition` from updating `Position` and raising `PositionChanged` after manual scrolling. #### Description of change A shared `containerSize` value is used that selects the appropriate container dimension for the active scroll axis: - horizontal CarouselView: `offset.X` and container width; - vertical CarouselView: `offset.Y` and container height. The effective item size now derives from `containerSize`, allowing a vertically snapped item to resolve to its correct integer page and update `Position` through the existing `SetPosition` path. <!-- Enter description of the fix in this section --> ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #39371 ### Tested the behavior in the following platforms - [ ] Windows - [ ] Android - [x] iOS - [ ] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <video src="https://github.com/user-attachments/assets/35aaca5b-28d4-4f6b-ba7d-c91c287c546a"> | <video src="https://github.com/user-attachments/assets/4cd53a07-4c3e-4a76-9f12-dbea49d075da"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
<!-- 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 In iOS `CarouselView` vertical scroll, the native scroll offset was divided by the container `width` instead of its `height`. This produced a fractional page value, preventing `SetPosition` from updating `Position` and raising `PositionChanged` after manual scrolling. #### Description of change A shared `containerSize` value is used that selects the appropriate container dimension for the active scroll axis: - horizontal CarouselView: `offset.X` and container width; - vertical CarouselView: `offset.Y` and container height. The effective item size now derives from `containerSize`, allowing a vertically snapped item to resolve to its correct integer page and update `Position` through the existing `SetPosition` path. <!-- Enter description of the fix in this section --> ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #39371 ### Tested the behavior in the following platforms - [ ] Windows - [ ] Android - [x] iOS - [ ] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <video src="https://github.com/user-attachments/assets/35aaca5b-28d4-4f6b-ba7d-c91c287c546a"> | <video src="https://github.com/user-attachments/assets/4cd53a07-4c3e-4a76-9f12-dbea49d075da"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
<!-- 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 In iOS `CarouselView` vertical scroll, the native scroll offset was divided by the container `width` instead of its `height`. This produced a fractional page value, preventing `SetPosition` from updating `Position` and raising `PositionChanged` after manual scrolling. #### Description of change A shared `containerSize` value is used that selects the appropriate container dimension for the active scroll axis: - horizontal CarouselView: `offset.X` and container width; - vertical CarouselView: `offset.Y` and container height. The effective item size now derives from `containerSize`, allowing a vertically snapped item to resolve to its correct integer page and update `Position` through the existing `SetPosition` path. <!-- Enter description of the fix in this section --> ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #39371 ### Tested the behavior in the following platforms - [ ] Windows - [ ] Android - [x] iOS - [ ] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <video src="https://github.com/user-attachments/assets/35aaca5b-28d4-4f6b-ba7d-c91c287c546a"> | <video src="https://github.com/user-attachments/assets/4cd53a07-4c3e-4a76-9f12-dbea49d075da"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->

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
In iOS
CarouselViewvertical scroll, the native scroll offset was divided by the containerwidthinstead of itsheight. This produced a fractional page value, preventingSetPositionfrom updatingPositionand raisingPositionChangedafter manual scrolling.Description of change
A shared
containerSizevalue is used that selects the appropriate container dimension for the active scroll axis:offset.Xand container width;offset.Yand container height.The effective item size now derives from
containerSize, allowing a vertically snapped item to resolve to its correct integer page and updatePositionthrough the existingSetPositionpath.Issues Fixed
Fixes #39371
Tested the behavior in the following platforms
BeforeFix39371.mov
AfterFix39371.mov