Skip to content

[Inflight/Candidate][Revert] [iOS] Fix for CollectionView layout issue after iOS device rotation #38771 - #39707

Merged
kubaflo merged 1 commit into
dotnet:inflight/candidatefrom
TamilarasanSF4853:revert-38771
Oct 27, 2026
Merged

kubaflo merged 1 commit into
dotnet:inflight/candidatefrom
TamilarasanSF4853:revert-38771

Conversation

@TamilarasanSF4853

@TamilarasanSF4853 TamilarasanSF4853 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

The backport PR #38815 caused LayoutPassesShouldNotIncrease to fail (iOS 18.5) in the previous candidate #38782. This PR #39396 fixed that failure, and the candidate was subsequently merged into main.

However, the current inflight candidate, #39597, appears to have overwritten that fix with the earlier backport similar changes, possibly during conflict resolution, causing LayoutPassesShouldNotIncrease to fail again.

I have now reverted the conflicting changes 4c29bf0 in the candidate to preserve the fix already present in main.

@dotnet-policy-service dotnet-policy-service Bot added the community ✨ Community Contribution label Oct 27, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey there @@TamilarasanSF4853! 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 Oct 27, 2026
@azure-pipelines

This comment has been minimized.

@sheiksyedm
sheiksyedm marked this pull request as ready for review October 27, 2026 14:47
@sheiksyedm
sheiksyedm requested a review from kubaflo October 27, 2026 14:47
@sheiksyedm sheiksyedm changed the title [Revert] [iOS] Fix for CollectionView layout issue after iOS device rotation #38771 [Inflight/Candidate][Revert] [iOS] Fix for CollectionView layout issue after iOS device rotation #38771 Oct 27, 2026
@kubaflo
kubaflo merged commit 120cd23 into dotnet:inflight/candidate Oct 27, 2026
9 of 18 checks passed
@github-actions github-actions Bot added this to the .NET 10 SR13 milestone Oct 27, 2026
github-actions Bot pushed a commit that referenced this pull request Oct 28, 2026
…e after iOS device rotation #38771 (#39707)

The backport PR #38815 caused LayoutPassesShouldNotIncrease to fail (iOS
18.5) in the previous candidate #38782. This PR #39396 fixed that
failure, and the candidate was subsequently merged into main.

However, the current inflight candidate, #39597, appears to have
overwritten that fix with the earlier backport similar changes, possibly
during conflict resolution, causing LayoutPassesShouldNotIncrease to
fail again.

I have now reverted the conflicting changes
4c29bf0
in the candidate to preserve the fix already present in main.
kubaflo pushed a commit that referenced this pull request Nov 4, 2026
…ion (#39891)

<!-- 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

RTL CollectionView items can become horizontally displaced after device
rotation and scrolling. During preferred sizing, the managed item is
arranged before UIKit applies the updated native bounds. RTL positioning
can therefore use the previous parent width. Existing layout
optimizations may skip a subsequent managed arrangement, leaving
recycled items incorrectly positioned.

This change:
- Tracks the native content width used during managed arrangement.
- Corrects the native item position when an RTL cell receives a
different content width.
- Reuses the existing native arrangement path without adding managed
subtree arrange passes.
- Adds LTR and RTL device tests covering initial sizing,
widening/narrowing, reuse, and managed-arrange counts.

The fix uses `TemplatedCell2.LayoutSubviews`. It does not modify
`ItemsViewController2` or restore the removed `ViewDidLayoutSubviews`
override.

Validation on iOS:
- Reproduced the issue in Sandbox using the post-revert SR13 source.
- Confirmed the RTL regression test fails without the fix: native X is
−200 instead of 0.
- Confirmed both RTL and LTR cases pass with the fix.
- Confirmed the Sandbox rotation-and-scroll scenario remains aligned.

### Regression reason

This regression issue was originally introduced by PR #37437. A fix was
later added through PR #38771 and merged into the candidate branch.
However, the fix was subsequently reverted by PR #39707 due to test
failures encountered during validation.

### 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 #38622

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 27, 2026

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — 61f0f0c4 Deployed Oct 27, 2026 by TamilarasanSF4853 via conclusion #2540
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants