Skip to content

Commit

Permalink
fix(ios): no need to traversal sibling views for next responder
Browse files Browse the repository at this point in the history
  • Loading branch information
ozonelmy committed Jul 11, 2023
1 parent 7f26aac commit 8cd726a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 22 deletions.
2 changes: 1 addition & 1 deletion ios/sdk/base/HippyTouchHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ - (UIView *)rootView:(UIView *)view {

if (touchInterceptEvent)
break;
view = [view nextResponseViewAtPoint:point];
view = view.superview;
index++;
}
}
Expand Down
20 changes: 0 additions & 20 deletions ios/sdk/component/view/HippyView.m
Original file line number Diff line number Diff line change
Expand Up @@ -134,26 +134,6 @@ - (UIView *)hippy_findClipView {
return clipView ?: self.window;
}

- (UIView *)nextResponseViewAtPoint:(CGPoint)point {
UIView *superView = [self superview];
if (superView && self.hippyTag) {
NSArray<UIView *> *subviews = [superView subviews];
NSUInteger index = [subviews indexOfObject:self];
if (0 != index) {
for (NSInteger i = index - 1; i >= 0; i--) {
UIView *siblingView = subviews[i];
CGPoint pointInsiblingView = [self convertPoint:point toView:siblingView];
BOOL pointInside = isPointInsideView(siblingView, pointInsiblingView);
if (pointInside) {
UIView *hitTestView = [siblingView hitTest:pointInsiblingView withEvent:nil];
return hitTestView ? hitTestView : siblingView;
}
}
}
}
return superView;
}

@end

static NSString *HippyRecursiveAccessibilityLabel(UIView *view) {
Expand Down
1 change: 0 additions & 1 deletion ios/sdk/component/view/UIView+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
- (void)hippy_remountAllSubviews;
- (void)hippy_updateClippedSubviewsWithClipRect:(CGRect)clipRect relativeToView:(UIView *)clipView;
- (UIView *)hippy_findClipView;
- (UIView *)nextResponseViewAtPoint:(CGPoint)point;

// zIndex sorting
- (void)clearSortedSubviews;
Expand Down

0 comments on commit 8cd726a

Please sign in to comment.