From 5769234448fec30d8da036ca6714c24aa0f1ab1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hans=20Kn=C3=B6chel?= Date: Thu, 12 Dec 2024 18:59:53 +0100 Subject: [PATCH] Revert "fix(android): ios click speed (#14115)" This reverts commit 6cc8830f874474a176cc181390e4d3c18f7b8b38. --- iphone/TitaniumKit/TitaniumKit/Sources/API/TiUIView.m | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/iphone/TitaniumKit/TitaniumKit/Sources/API/TiUIView.m b/iphone/TitaniumKit/TitaniumKit/Sources/API/TiUIView.m index 3f0331e6921..f433f0bd01f 100644 --- a/iphone/TitaniumKit/TitaniumKit/Sources/API/TiUIView.m +++ b/iphone/TitaniumKit/TitaniumKit/Sources/API/TiUIView.m @@ -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) { @@ -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]; } @@ -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; }