-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[TIMOB-16680] iOS: listView when views overlap itemclick event return wrong bindId #6211
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1864,26 +1864,27 @@ + (UITableViewRowAnimation)animationStyleForProperties:(NSDictionary*)properties | |
|
||
static TiViewProxy * FindViewProxyWithBindIdContainingPoint(UIView *view, CGPoint point) | ||
{ | ||
if (!CGRectContainsPoint([view bounds], point)) { | ||
return nil; | ||
} | ||
for (UIView *subview in [view subviews]) { | ||
TiViewProxy *viewProxy = FindViewProxyWithBindIdContainingPoint(subview, [view convertPoint:point toView:subview]); | ||
if (viewProxy != nil) { | ||
id bindId = [viewProxy valueForKey:@"bindId"]; | ||
if (bindId != nil) { | ||
return viewProxy; | ||
} | ||
} | ||
} | ||
if ([view isKindOfClass:[TiUIView class]]) { | ||
TiViewProxy *viewProxy = (TiViewProxy *)[(TiUIView *)view proxy]; | ||
id bindId = [viewProxy valueForKey:@"bindId"]; | ||
if (bindId != nil) { | ||
return viewProxy; | ||
} | ||
} | ||
return nil; | ||
if (!CGRectContainsPoint([view bounds], point)) { | ||
return nil; | ||
} | ||
for (int i = [view.subviews count]-1; i >=0; i--){ | ||
UIView *subview = [view.subviews objectAtIndex:i]; | ||
TiViewProxy *viewProxy = FindViewProxyWithBindIdContainingPoint(subview, [view convertPoint:point toView:subview]); | ||
if (viewProxy != nil) { | ||
id bindId = [viewProxy valueForKey:@"bindId"]; | ||
if (bindId != nil && subview.userInteractionEnabled) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove subview.userInteractionEnabled. The default value is not necessarily true for all UI components. It will confuse the developers to have an extra check to make sure this condition is fulfilled. Moreover, this check is not necessary to solve this ticket. So if this particular issue arises in the future, we will open another ticket. |
||
return viewProxy; | ||
} | ||
} | ||
} | ||
if ([view isKindOfClass:[TiUIView class]]) { | ||
TiViewProxy *viewProxy = (TiViewProxy *)[(TiUIView *)view proxy]; | ||
id bindId = [viewProxy valueForKey:@"bindId"]; | ||
if (bindId != nil) { | ||
return viewProxy; | ||
} | ||
} | ||
return nil; | ||
} | ||
|
||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put a (int) cast here, (int)[views.subviews count]-1
to remove Xcode warning.