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

[TIMOB-19924](6_1_X): iOS "onclick" event is not triggered in the WebView if you are listening to multiple "click" events #8956

Merged
merged 2 commits into from
Apr 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion iphone/Classes/TiUIView.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void ModifyScrollViewForKeyboardHeightAndContentHeightWithResponderRect(UIScroll
#ifdef TI_USE_AUTOLAYOUT
@interface TiUIView : TiLayoutView<TiProxyDelegate>
#else
@interface TiUIView : UIView<TiProxyDelegate, LayoutAutosizing>
@interface TiUIView : UIView<TiProxyDelegate, LayoutAutosizing, UIGestureRecognizerDelegate>
#endif
{
@protected
Expand Down
12 changes: 10 additions & 2 deletions iphone/Classes/TiUIView.m
Original file line number Diff line number Diff line change
Expand Up @@ -1046,11 +1046,11 @@ -(UITapGestureRecognizer*)singleTapRecognizer
singleTapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(recognizedTap:)];
[self configureGestureRecognizer:singleTapRecognizer];
[self addGestureRecognizer:singleTapRecognizer];

if (doubleTapRecognizer != nil) {
[singleTapRecognizer requireGestureRecognizerToFail:doubleTapRecognizer];
}
}
singleTapRecognizer.delegate = self;
return singleTapRecognizer;
}

Expand All @@ -1064,8 +1064,9 @@ -(UITapGestureRecognizer*)doubleTapRecognizer

if (singleTapRecognizer != nil) {
[singleTapRecognizer requireGestureRecognizerToFail:doubleTapRecognizer];
}
}
}
doubleTapRecognizer.delegate = self;
return doubleTapRecognizer;
}

Expand All @@ -1077,6 +1078,7 @@ -(UITapGestureRecognizer*)twoFingerTapRecognizer
[self configureGestureRecognizer:twoFingerTapRecognizer];
[self addGestureRecognizer:twoFingerTapRecognizer];
}
twoFingerTapRecognizer.delegate = self;
return twoFingerTapRecognizer;
}

Expand All @@ -1087,6 +1089,7 @@ -(UIPinchGestureRecognizer*)pinchRecognizer
[self configureGestureRecognizer:pinchRecognizer];
[self addGestureRecognizer:pinchRecognizer];
}
pinchRecognizer.delegate = self;
return pinchRecognizer;
}

Expand All @@ -1098,6 +1101,7 @@ -(UISwipeGestureRecognizer*)leftSwipeRecognizer
[self configureGestureRecognizer:leftSwipeRecognizer];
[self addGestureRecognizer:leftSwipeRecognizer];
}
leftSwipeRecognizer.delegate = self;
return leftSwipeRecognizer;
}

Expand All @@ -1109,6 +1113,7 @@ -(UISwipeGestureRecognizer*)rightSwipeRecognizer
[self configureGestureRecognizer:rightSwipeRecognizer];
[self addGestureRecognizer:rightSwipeRecognizer];
}
rightSwipeRecognizer.delegate = self;
return rightSwipeRecognizer;
}
-(UISwipeGestureRecognizer*)upSwipeRecognizer
Expand All @@ -1119,6 +1124,7 @@ -(UISwipeGestureRecognizer*)upSwipeRecognizer
[self configureGestureRecognizer:upSwipeRecognizer];
[self addGestureRecognizer:upSwipeRecognizer];
}
upSwipeRecognizer.delegate = self;
return upSwipeRecognizer;
}
-(UISwipeGestureRecognizer*)downSwipeRecognizer
Expand All @@ -1129,6 +1135,7 @@ -(UISwipeGestureRecognizer*)downSwipeRecognizer
[self configureGestureRecognizer:downSwipeRecognizer];
[self addGestureRecognizer:downSwipeRecognizer];
}
downSwipeRecognizer.delegate = self;
return downSwipeRecognizer;
}

Expand All @@ -1139,6 +1146,7 @@ -(UILongPressGestureRecognizer*)longPressRecognizer
[self configureGestureRecognizer:longPressRecognizer];
[self addGestureRecognizer:longPressRecognizer];
}
longPressRecognizer.delegate = self;
return longPressRecognizer;
}

Expand Down
7 changes: 7 additions & 0 deletions iphone/Classes/TiUIWebView.m
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,13 @@ - (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectio
return [[protectionSpace authenticationMethod] isEqualToString:NSURLAuthenticationMethodServerTrust];
}

#pragma mark UIGestureRecognizer Delegates

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer;
{
return !willHandleTouches;
}

#pragma mark TiEvaluator

- (void)evalFile:(NSString*)path
Expand Down