Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ios): no need to traversal sibling views for next responder #3255

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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