Reset internal state of RCTScrollViewComponentView in scrollViewDidEndDragging

Summary:
changelog: [internal]

`_isUserTriggeredScrolling` must be NO when user interaction stops. This was not the case when user scrolled -> lifted finger but the scroll did not decelerate into position. The case with deceleration is handled in method `scrollViewDidEndDecelerating`.

Reviewed By: javache

Differential Revision: D45147325

fbshipit-source-id: 1b55dc708c4c7d6cffa917a822eb2b569b22dbb2
This commit is contained in:
Samuel Susla
2023-04-21 10:43:17 -07:00
committed by Facebook GitHub Bot
parent 81d8992ceb
commit bd64699f0a
@@ -492,7 +492,14 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
}
std::static_pointer_cast<ScrollViewEventEmitter const>(_eventEmitter)->onScrollEndDrag([self _scrollViewMetrics]);
[self _updateStateWithContentOffset];
if (!decelerate) {
// ScrollView will not decelerate and `scrollViewDidEndDecelerating` will not be called.
// `_isUserTriggeredScrolling` must be set to NO here.
_isUserTriggeredScrolling = NO;
}
}
- (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView