Fixed hitTest crash due to sticky header out-of-range
Reviewed By: javache Differential Revision: D2932227 fb-gh-sync-id: 05d69ec391685dd7e72d3d5f7d56b189a6eab413 shipit-source-id: 05d69ec391685dd7e72d3d5f7d56b189a6eab413
This commit is contained in:
parent
9547264a96
commit
194273f5f5
|
@ -349,8 +349,14 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
|
||||||
{
|
{
|
||||||
__block UIView *hitView;
|
__block UIView *hitView;
|
||||||
|
|
||||||
|
NSArray *subviews = [self contentView].reactSubviews;
|
||||||
|
NSUInteger subviewCount = subviews.count;
|
||||||
[_stickyHeaderIndices enumerateIndexesWithOptions:0 usingBlock:^(NSUInteger idx, BOOL *stop) {
|
[_stickyHeaderIndices enumerateIndexesWithOptions:0 usingBlock:^(NSUInteger idx, BOOL *stop) {
|
||||||
UIView *stickyHeader = [self contentView].reactSubviews[idx];
|
if (idx >= subviewCount) {
|
||||||
|
*stop = YES;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
UIView *stickyHeader = subviews[idx];
|
||||||
CGPoint convertedPoint = [stickyHeader convertPoint:point fromView:self];
|
CGPoint convertedPoint = [stickyHeader convertPoint:point fromView:self];
|
||||||
hitView = [stickyHeader hitTest:convertedPoint withEvent:event];
|
hitView = [stickyHeader hitTest:convertedPoint withEvent:event];
|
||||||
*stop = (hitView != nil);
|
*stop = (hitView != nil);
|
||||||
|
|
Loading…
Reference in New Issue