Fix ScrollView Content Misalignment in RTL FlowDirection with Dynamic Content#31752
Open
jsuarezruiz wants to merge 7 commits intonet10.0from
Open
Fix ScrollView Content Misalignment in RTL FlowDirection with Dynamic Content#31752jsuarezruiz wants to merge 7 commits intonet10.0from
jsuarezruiz wants to merge 7 commits intonet10.0from
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a ScrollView content misalignment issue in RTL (Right-to-Left) FlowDirection when views are dynamically added. The problem manifested as limited scrolling range, excessive empty space, and content appearing empty during LTR to RTL transitions.
- Modified RTL layout handling to only apply content arrangement adjustments during layout direction changes
- Replaced continuous RTL offset calculations with conditional logic based on layout direction changes
- Added comprehensive UI tests to validate RTL/LTR scrolling behavior and content positioning
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 13 comments.
| File | Description |
|---|---|
| src/Core/src/Platform/iOS/MauiScrollView.cs | Core fix - conditionalizes RTL layout adjustments to prevent misalignment with dynamic content |
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue31610.cs | NUnit UI tests validating RTL/LTR scrolling behavior and dynamic content handling |
| src/Controls/tests/TestCases.HostApp/Issues/Issue31610.cs | Test UI page demonstrating RTL ScrollView with dynamic content for automated testing |
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue31610.cs
Outdated
Show resolved
Hide resolved
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue31610.cs
Outdated
Show resolved
Hide resolved
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue31610.cs
Outdated
Show resolved
Hide resolved
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue31610.cs
Outdated
Show resolved
Hide resolved
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue31610.cs
Outdated
Show resolved
Hide resolved
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue31610.cs
Outdated
Show resolved
Hide resolved
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue31610.cs
Outdated
Show resolved
Hide resolved
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue31610.cs
Outdated
Show resolved
Hide resolved
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue31610.cs
Outdated
Show resolved
Hide resolved
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue31610.cs
Outdated
Show resolved
Hide resolved
Collaborator
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
This PR fixes issue #31610 where ScrollView content becomes misaligned in Right-to-Left (RTL) FlowDirection when views are added dynamically. Testing can detect:
The problem occurred in
MauiScrollView.CrossPlatformArrange()where RTL offset calculations were being applied on every layout pass, causing content to be incorrectly positioned when dynamic content was added. Modified RTL layout handling to only apply content arrangement adjustments during layout direction changes.Added UI tests validating RTL/LTR scrolling behavior and content positioning.
Issues Fixed
Fixes #31610