Skip to content

Commit

Permalink
Revert "fix(android): ios click speed (#14115)"
Browse files Browse the repository at this point in the history
This reverts commit 6cc8830.
  • Loading branch information
hansemannn authored Dec 12, 2024
1 parent 66d9df7 commit 5769234
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions iphone/TitaniumKit/TitaniumKit/Sources/API/TiUIView.m
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,6 @@ - (UITapGestureRecognizer *)singleTapRecognizer
{
if (singleTapRecognizer == nil) {
singleTapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(recognizedTap:)];
[singleTapRecognizer setNumberOfTapsRequired:1];
[self configureGestureRecognizer:singleTapRecognizer];
[self addGestureRecognizer:singleTapRecognizer];
if (doubleTapRecognizer != nil) {
Expand Down Expand Up @@ -1435,8 +1434,6 @@ - (void)recognizedTap:(UITapGestureRecognizer *)recognizer
[proxy fireEvent:@"dblclick" withObject:event propagate:YES];
}
[proxy fireEvent:@"doubletap" withObject:event];
} else if ([recognizer numberOfTapsRequired] == 1 && [proxy _hasListeners:@"click"]) {
[proxy fireEvent:@"click" withObject:event propagate:YES];
} else {
[proxy fireEvent:@"singletap" withObject:event];
}
Expand Down Expand Up @@ -1612,7 +1609,12 @@ - (void)processTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
// Click handling is special; don't propagate if we have a delegate,
// but DO invoke the touch delegate.
// clicks should also be handled by any control the view is embedded in.
if ([touch tapCount] == 2 && [proxy _hasListeners:@"dblclick"]) {
if ([touch tapCount] == 1 && [proxy _hasListeners:@"click"]) {
if (touchDelegate == nil) {
[proxy fireEvent:@"click" withObject:evt propagate:YES];
return;
}
} else if ([touch tapCount] == 2 && [proxy _hasListeners:@"dblclick"]) {
[proxy fireEvent:@"dblclick" withObject:evt propagate:YES];
return;
}
Expand Down

0 comments on commit 5769234

Please sign in to comment.