Always run the momentum scroll Runnable so scroll position is updated on Fabric

Summary:
This early return is a very minor perf optimization, and it complicates things on Fabric: if scroll perf logging is disabled, the scroll position in C++ (State) doesn't get updated for the scrollview.

Just remove it. Always run the Runnable, no matter what.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D21503695

fbshipit-source-id: 13dfe232d692ff544bff725a2344a66b572f5444
This commit is contained in:
Joshua Gross
2020-05-11 11:14:17 -07:00
committed by Facebook GitHub Bot
parent 3c9013402e
commit dba588741c
2 changed files with 0 additions and 14 deletions
@@ -607,16 +607,9 @@ public class ReactHorizontalScrollView extends HorizontalScrollView
* runnable that checks if we scrolled in the last frame and if so assumes we are still scrolling.
*/
private void handlePostTouchScrolling(int velocityX, int velocityY) {
// If we aren't going to do anything (send events or snap to page), we can early exit out.
if (!mSendMomentumEvents && !mPagingEnabled && !isScrollPerfLoggingEnabled()) {
updateStateOnScroll();
return;
}
// Check if we are already handling this which may occur if this is called by both the touch up
// and a fling call
if (mPostTouchRunnable != null) {
updateStateOnScroll();
return;
}
@@ -494,16 +494,9 @@ public class ReactScrollView extends ScrollView
* runnable that checks if we scrolled in the last frame and if so assumes we are still scrolling.
*/
private void handlePostTouchScrolling(int velocityX, int velocityY) {
// If we aren't going to do anything (send events or snap to page), we can early exit out.
if (!mSendMomentumEvents && !mPagingEnabled && !isScrollPerfLoggingEnabled()) {
updateStateOnScroll();
return;
}
// Check if we are already handling this which may occur if this is called by both the touch up
// and a fling call
if (mPostTouchRunnable != null) {
updateStateOnScroll();
return;
}