diff --git a/ios/ShadowListContainer.mm b/ios/ShadowListContainer.mm index 4cef289..0685129 100644 --- a/ios/ShadowListContainer.mm +++ b/ios/ShadowListContainer.mm @@ -24,6 +24,7 @@ @implementation ShadowListContainer { BOOL _scrollContainerLayoutComplete; BOOL _scrollContainerLayoutHorizontal; BOOL _scrollContainerLayoutInverted; + BOOL _scrollContainerScrolling; } + (ComponentDescriptorProvider)componentDescriptorProvider @@ -101,6 +102,36 @@ - (void)updateState:(const State::Shared &)state oldState:(const State::Shared & [self recycle]; } +- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { + _scrollContainerScrolling = YES; +} + +- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate { + if (!decelerate) { + [self scrollViewDidEndScrolling:scrollView]; + } +} + +- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { + [self scrollViewDidEndScrolling:scrollView]; +} + +- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView { + [self scrollViewDidEndScrolling:scrollView]; +} + +- (void)scrollViewDidEndScrolling:(UIScrollView *)scrollView { + _scrollContainerScrolling = NO; +} + +- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event +{ + if (_scrollContainerScrolling) { + return self->_scrollContainer; + } + return [super hitTest:point withEvent:event]; +} + - (void)scrollViewDidScroll:(UIScrollView *)scrollView { const auto &props = static_cast(*_props);