Skip to content

Commit 00d8389

Browse files
NickGerlemanhuntie
authored andcommitted
Fix horizontal scrollview scrollTo coordinate space in RTL on oldarch (#42094)
Summary: Pull Request resolved: #42094 Fabric fixed this a while back with 9ca460f Looks like this is still broken on Paper, and now VirtualizedList relies on it. #38737 (comment) Changelog: [ios][fixed] - Fix horizontal scrollview scrollTo coordinate space in RTL on oldarch Reviewed By: lenaic Differential Revision: D52451602 fbshipit-source-id: f41d8248c7f6ab23965800b09ca1082fd1a15151
1 parent ddf0079 commit 00d8389

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/react-native/React/Views/ScrollView/RCTScrollView.m

+4
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,10 @@ - (void)scrollToOffset:(CGPoint)offset
568568

569569
- (void)scrollToOffset:(CGPoint)offset animated:(BOOL)animated
570570
{
571+
if ([self reactLayoutDirection] == UIUserInterfaceLayoutDirectionRightToLeft) {
572+
offset.x = _scrollView.contentSize.width - _scrollView.frame.size.width - offset.x;
573+
}
574+
571575
if (!CGPointEqualToPoint(_scrollView.contentOffset, offset)) {
572576
CGRect maxRect = CGRectMake(
573577
fmin(-_scrollView.contentInset.left, 0),

0 commit comments

Comments
 (0)