From e726e91eba53829641e0a597440ef324dd54aaa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20Antoni=20Kwa=C5=9Bniewski?= Date: Fri, 27 Mar 2026 10:37:56 +0100 Subject: [PATCH] fix? --- .../apple/RNGestureHandlerButton.mm | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/packages/react-native-gesture-handler/apple/RNGestureHandlerButton.mm b/packages/react-native-gesture-handler/apple/RNGestureHandlerButton.mm index c433e64bec..0558c84280 100644 --- a/packages/react-native-gesture-handler/apple/RNGestureHandlerButton.mm +++ b/packages/react-native-gesture-handler/apple/RNGestureHandlerButton.mm @@ -223,6 +223,37 @@ - (void)animateTarget:(RNGHUIView *)target toOpacity:(CGFloat)opacity scale:(CGF #endif } +#if !TARGET_OS_OSX + +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event +{ + [super touchesBegan:touches withEvent:event]; + UITouch *touch = [touches anyObject]; + if (touch.view != self) { + [self sendActionsForControlEvents:UIControlEventTouchDown]; + } +} + +- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event +{ + [super touchesEnded:touches withEvent:event]; + UITouch *touch = [touches anyObject]; + if (touch.view != self) { + [self sendActionsForControlEvents:UIControlEventTouchUpInside]; + } +} + +- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event +{ + [super touchesCancelled:touches withEvent:event]; + UITouch *touch = [touches anyObject]; + if (touch.view != self) { + [self sendActionsForControlEvents:UIControlEventTouchCancel]; + } +} + +#endif + - (void)handleAnimatePressIn { RNGHUIView *target = self.animationTarget ?: self;