Skip to content

Fix RTL content offsets in horizontal ScrollView on iOS - #59480

Open
zoontek wants to merge 6 commits into
react:mainfrom
zoontek:fix-ios-rtl-scrollview-measure
Open

zoontek wants to merge 6 commits into
react:mainfrom
zoontek:fix-ios-rtl-scrollview-measure

Conversation

@zoontek

@zoontek zoontek commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Summary:

On iOS, an RTL horizontal ScrollView is mirrored, so its UIKit offset counts from the right edge. scrollTo and onScroll converted it, but the contentOffset prop and ScrollViewState did not. As a result, measure returned wrong x values (#55153), and the prop and scrollTo showed different pages (#58534).

Offsets now count from the left edge everywhere on iOS, like Android. Android code paths are unchanged.

Fixes #55153
Fixes #58534

Changelog:

[IOS] [FIXED] - Fix measure, measureInWindow and the contentOffset prop in RTL horizontal ScrollView

Test Plan:

Added two RNTester examples under ScrollView, "in RTL measure" and "in RTL contentOffset". Ran them on the iOS simulator:

Case Before After
measureInWindow x (button at 46) -434 46
contentOffset={{x: 600}} vs scrollTo({x: 600}) Page 3 vs Page 2 Page 2 for both

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 26, 2026
@facebook-github-tools facebook-github-tools Bot added p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Oct 26, 2026
@github-actions

Copy link
Copy Markdown

Visual regression

No visual differences at 8afc813fb34d.

android: no capture

This branch has not been deployed

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

1 participant