Skip to content

Commit 2893ba8

Browse files
committed
Fix autoscroll threshold on iOS
1 parent f166ba2 commit 2893ba8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

React/Views/ScrollView/RCTScrollView.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ - (void)uiManagerWillPerformMounting:(RCTUIManager *)manager
944944
CGPointMake(self->_scrollView.contentOffset.x + deltaX, self->_scrollView.contentOffset.y);
945945
if (autoscrollThreshold != nil) {
946946
// If the offset WAS within the threshold of the start, animate to the start.
947-
if (x - deltaX <= [autoscrollThreshold integerValue]) {
947+
if (x <= [autoscrollThreshold integerValue]) {
948948
[self scrollToOffset:CGPointMake(-leftInset, self->_scrollView.contentOffset.y) animated:YES];
949949
}
950950
}
@@ -960,7 +960,7 @@ - (void)uiManagerWillPerformMounting:(RCTUIManager *)manager
960960
CGPointMake(self->_scrollView.contentOffset.x, self->_scrollView.contentOffset.y + deltaY);
961961
if (autoscrollThreshold != nil) {
962962
// If the offset WAS within the threshold of the start, animate to the start.
963-
if (y - deltaY <= [autoscrollThreshold integerValue]) {
963+
if (y <= [autoscrollThreshold integerValue]) {
964964
[self scrollToOffset:CGPointMake(self->_scrollView.contentOffset.x, -bottomInset) animated:YES];
965965
}
966966
}

0 commit comments

Comments
 (0)