Skip to content

Commit a034841

Browse files
rozelemeta-codesync[bot]
authored andcommitted
Fix likely bug in maintainVisibleContentPosition (facebook#54363)
Summary: Pull Request resolved: facebook#54363 The calculus for active scroll maintainVisibleContentPosition is not isomorphic between ReactHorizontalScrollView and ReactScrollView. Additiionally, it doesn't make sense that we would use an x-offset in a y-offset calculation. This fixes a likely bug where the OverScroller's x-offset is used to compute the scroll animation update in ReactScrollView.recreateFlingAnimation. ## Changelog [Android][Fixed] - Issue with restarting scroll in maintainVisibleContentPosition Reviewed By: javache Differential Revision: D86021007 fbshipit-source-id: 0d7febcbccd59df534bacbba7f1b5bb5085fa95f
1 parent 19d87c8 commit a034841

File tree

1 file changed

+1
-1
lines changed
  • packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll

1 file changed

+1
-1
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1367,7 +1367,7 @@ private void recreateFlingAnimation(int scrollY) {
13671367

13681368
mScroller.fling(getScrollX(), scrollY, 0, (int) flingVelocityY, 0, 0, 0, Integer.MAX_VALUE);
13691369
} else {
1370-
scrollTo(getScrollX(), scrollY + (mScroller.getCurrX() - scrollerYBeforeTick));
1370+
scrollTo(getScrollX(), scrollY + (mScroller.getCurrY() - scrollerYBeforeTick));
13711371
}
13721372
}
13731373
}

0 commit comments

Comments
 (0)