Skip to content

Commit

Permalink
Fix horiozntal scrollview scrollTo coordinate space in RTL on oldarch (
Browse files Browse the repository at this point in the history
…facebook#42094)

Summary:

Fabric fixed this a while back with facebook@9ca460f

Looks like this is still broken on Paper, and now VirtualizedList relies on it. facebook#38737 (comment)

Changelog:
[ios][fixed] - Fix horiozntal scrollview scrollTo coordinate space in RTL on oldarch

Reviewed By: lenaic

Differential Revision: D52451602
  • Loading branch information
NickGerleman authored and facebook-github-bot committed Jan 3, 2024
1 parent b81a081 commit f8cde4b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/react-native/React/Views/ScrollView/RCTScrollView.m
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,10 @@ - (void)scrollToOffset:(CGPoint)offset

- (void)scrollToOffset:(CGPoint)offset animated:(BOOL)animated
{
if ([self reactLayoutDirection] == UIUserInterfaceLayoutDirectionRightToLeft) {
offset.x = _scrollView.contentSize.width - _scrollView.frame.size.width - offset.x;
}

if (!CGPointEqualToPoint(_scrollView.contentOffset, offset)) {
CGRect maxRect = CGRectMake(
fmin(-_scrollView.contentInset.left, 0),
Expand Down

0 comments on commit f8cde4b

Please sign in to comment.