mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Fix likely bug in maintainVisibleContentPosition (#54363)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/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
This commit is contained in:
1 parent
19d87c874e
commit
a034841fd6
1 file changed
+1
-1
+1
-1
@@ -1367,7 +1367,7 @@ public class ReactScrollView extends ScrollView
|
||||
|
||||
mScroller.fling(getScrollX(), scrollY, 0, (int) flingVelocityY, 0, 0, 0, Integer.MAX_VALUE);
|
||||
} else {
|
||||
scrollTo(getScrollX(), scrollY + (mScroller.getCurrX() - scrollerYBeforeTick));
|
||||
scrollTo(getScrollX(), scrollY + (mScroller.getCurrY() - scrollerYBeforeTick));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user