diff --git a/React/Views/RCTScrollView.m b/React/Views/RCTScrollView.m index d4a2ad5e95a3cf..d64a583af27d47 100644 --- a/React/Views/RCTScrollView.m +++ b/React/Views/RCTScrollView.m @@ -223,6 +223,24 @@ - (void)dockClosestSectionHeader } } +- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event +{ + __block UIView *stickyHeader; + + [_stickyHeaderIndices enumerateIndexesWithOptions:0 usingBlock:^(NSUInteger idx, BOOL *stop) { + stickyHeader = [self contentView].reactSubviews[idx]; + CGPoint convertedPoint = [stickyHeader convertPoint:point fromView:self]; + + if ([stickyHeader hitTest:convertedPoint withEvent:event]) { + *stop = YES; + } else { + stickyHeader = nil; + } + }]; + + return stickyHeader ?: [super hitTest:point withEvent:event]; +} + @end @implementation RCTScrollView