Skip to content

Commit

Permalink
Point must be converted to the stickyHeader's coordinate space and th…
Browse files Browse the repository at this point in the history
…en passed to the stickyHeaders hitTest:withEvent: method in order to be correctly routed to any subviews of the stickyHeader.

More performant fix.

Fix tabs.
  • Loading branch information
Tj authored and Tj committed Aug 4, 2015
1 parent fc9150c commit 46da788
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions React/Views/RCTScrollView.m
Original file line number Diff line number Diff line change
Expand Up @@ -339,20 +339,16 @@ - (void)dockClosestSectionHeader

- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
__block UIView *stickyHeader;
__block UIView *hitView;

[_stickyHeaderIndices enumerateIndexesWithOptions:0 usingBlock:^(NSUInteger idx, BOOL *stop) {
stickyHeader = [self contentView].reactSubviews[idx];
UIView *stickyHeader = [self contentView].reactSubviews[idx];
CGPoint convertedPoint = [stickyHeader convertPoint:point fromView:self];

if ([stickyHeader hitTest:convertedPoint withEvent:event]) {
*stop = YES;
} else {
stickyHeader = nil;
}
hitView = [stickyHeader hitTest:convertedPoint withEvent:event];
*stop = (hitView != nil);
}];

return stickyHeader ?: [super hitTest:point withEvent:event];
return hitView ?: [super hitTest:point withEvent:event];
}

@end
Expand Down

0 comments on commit 46da788

Please sign in to comment.