Skip to content

Fix ScrollView Content Misalignment in RTL FlowDirection with Dynamic Content#31752

Open
jsuarezruiz wants to merge 7 commits intonet10.0from
fix-31610
Open

Fix ScrollView Content Misalignment in RTL FlowDirection with Dynamic Content#31752
jsuarezruiz wants to merge 7 commits intonet10.0from
fix-31610

Conversation

@jsuarezruiz
Copy link
Contributor

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:

  • Limited scrolling range in RTL mode (unable to scroll to all items)
  • Excessive empty space on the right side
  • Content can appear empty when transitioning from LTR to RTL until scrolling begins

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

@jsuarezruiz jsuarezruiz added the t/bug Something isn't working label Sep 24, 2025
Copilot AI review requested due to automatic review settings September 24, 2025 09:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@MauiBot
Copy link
Collaborator

MauiBot commented Mar 27, 2026

⚠️ Merge Conflict Detected — This PR has merge conflicts with its target branch. Please rebase onto the target branch and resolve the conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-scrollview ScrollView platform/ios platform/macos macOS / Mac Catalyst t/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants