Skip to content

Commit e726e91

Browse files
committed
fix?
1 parent 5587435 commit e726e91

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
@@ -223,6 +223,37 @@ - (void)animateTarget:(RNGHUIView *)target toOpacity:(CGFloat)opacity scale:(CGF
223223
#endif
224224
}
225225

226+
#if !TARGET_OS_OSX
227+
228+
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
229+
{
230+
[super touchesBegan:touches withEvent:event];
231+
UITouch *touch = [touches anyObject];
232+
if (touch.view != self) {
233+
[self sendActionsForControlEvents:UIControlEventTouchDown];
234+
}
235+
}
236+
237+
- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
238+
{
239+
[super touchesEnded:touches withEvent:event];
240+
UITouch *touch = [touches anyObject];
241+
if (touch.view != self) {
242+
[self sendActionsForControlEvents:UIControlEventTouchUpInside];
243+
}
244+
}
245+
246+
- (void)touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
247+
{
248+
[super touchesCancelled:touches withEvent:event];
249+
UITouch *touch = [touches anyObject];
250+
if (touch.view != self) {
251+
[self sendActionsForControlEvents:UIControlEventTouchCancel];
252+
}
253+
}
254+
255+
#endif
256+
226257
- (void)handleAnimatePressIn
227258
{
228259
RNGHUIView *target = self.animationTarget ?: self;

0 commit comments

Comments
 (0)