KEMBAR78
[iOS] ScrollView content offset RTL - fix by kubaflo · Pull Request #30724 · dotnet/maui · GitHub
Skip to content

Conversation

@kubaflo
Copy link
Contributor

@kubaflo kubaflo commented Jul 20, 2025

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!

Description of Change

This PR #30453 regressed the fix introduced here #29469. The regression hasn't been caught by a flaky UI test, so I've improved it

@Copilot Copilot AI review requested due to automatic review settings July 20, 2025 00:00
@kubaflo kubaflo requested a review from a team as a code owner July 20, 2025 00:00
@kubaflo kubaflo self-assigned this Jul 20, 2025
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Jul 20, 2025
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 regression in iOS ScrollView content offset handling for Right-To-Left (RTL) layouts that was introduced by PR #30453, which had previously broken the fix from PR #29469. The fix refines the condition logic for RTL content offset adjustment and improves the UI test to better validate the behavior.

  • Refines the condition for when to adjust content offset in RTL layouts by adding a null check
  • Improves the UI test to use more robust position-based assertions instead of just waiting for elements

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Core/src/Platform/iOS/MauiScrollView.cs Fixes RTL content offset logic by adjusting conditional checks
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29458.cs Replaces flaky element wait with position-based assertions

@PureWeen
Copy link
Member

Do we need to backport this to sr9?

@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

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

The test ScrollViewShouldWorkInRTL is failing on Mac:

Assert.That(App.FindElement("Tab5LTR").GetRect().X, Is.LessThan(App.FindElement("RTLScrollView").GetRect().Width * 1.2f))
Expected: less than 948.000061f
But was:  1128

@kubaflo
Copy link
Contributor Author

kubaflo commented Jul 21, 2025

The test ScrollViewShouldWorkInRTL is failing on Mac:

Assert.That(App.FindElement("Tab5LTR").GetRect().X, Is.LessThan(App.FindElement("RTLScrollView").GetRect().Width * 1.2f))
Expected: less than 948.000061f
But was:  1128

This test is supposed to run on iOS and Android only. Fixed

@PureWeen PureWeen added this to the .NET 9 SR10 milestone Jul 27, 2025
@PureWeen PureWeen added p/0 Work that we can't release without regressed-in-9.0.90 i/regression This issue described a confirmed regression on a currently supported version labels Jul 27, 2025
@PureWeen
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen moved this from Todo to Ready To Review in MAUI SDK Ongoing Aug 4, 2025
@rmarinho
Copy link
Member

rmarinho commented Aug 6, 2025

/backport to release/9.0.1xx-sr9

@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2025

Started backporting to release/9.0.1xx-sr9: https://github.com/dotnet/maui/actions/runs/16772111700

@rmarinho rmarinho merged commit a1d2571 into dotnet:main Aug 6, 2025
129 checks passed
@github-project-automation github-project-automation bot moved this from Ready To Review to Done in MAUI SDK Ongoing Aug 6, 2025
SuthiYuvaraj pushed a commit to SuthiYuvaraj/maui that referenced this pull request Aug 12, 2025
* Fix Issue29458 and improve test

* Update Issue29458.cs
rmarinho pushed a commit that referenced this pull request Aug 13, 2025
* Fix Issue29458 and improve test

* Update Issue29458.cs
@github-actions github-actions bot locked and limited conversation to collaborators Sep 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-scrollview ScrollView community ✨ Community Contribution i/regression This issue described a confirmed regression on a currently supported version p/0 Work that we can't release without platform/ios regressed-in-9.0.90

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants