mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook GitHub Bot
parent
3c9013402e
commit
dba588741c
-7
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user