Skip to content

Commit c9a577c

Browse files
akwasniewskij-piasecki
authored andcommitted
fix?
1 parent d21f1dd commit c9a577c

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

packages/react-native-gesture-handler/apple/RNGestureHandlerButton.mm

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,37 @@ - (void)animateTarget:(RNGHUIView *)target
290290
#endif
291291
}
292292

293+
#if !TARGET_OS_OSX
294+
295+
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
296+
{
297+
[super touchesBegan:touches withEvent:event];
298+
UITouch *touch = [touches anyObject];
299+
if (touch.view != self) {
300+
[self sendActionsForControlEvents:UIControlEventTouchDown];
301+
}
302+
}
303+
304+
- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
305+
{
306+
[super touchesEnded:touches withEvent:event];
307+
UITouch *touch = [touches anyObject];
308+
if (touch.view != self) {
309+
[self sendActionsForControlEvents:UIControlEventTouchUpInside];
310+
}
311+
}
312+
313+
- (void)touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
314+
{
315+
[super touchesCancelled:touches withEvent:event];
316+
UITouch *touch = [touches anyObject];
317+
if (touch.view != self) {
318+
[self sendActionsForControlEvents:UIControlEventTouchCancel];
319+
}
320+
}
321+
322+
#endif
323+
293324
- (void)handleAnimatePressIn
294325
{
295326
if (_pendingPressOutBlock) {

0 commit comments

Comments
 (0)