Skip to content

Commit 288c458

Browse files
committed
Unbind actions
1 parent cdd6619 commit 288c458

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

packages/react-native-gesture-handler/apple/Handlers/RNNativeViewHandler.mm

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,14 @@ - (void)bindToView:(UIView *)view
167167

168168
- (void)unbindFromView
169169
{
170+
UIView *view = self.recognizer.view;
171+
172+
if ([view isKindOfClass:[UIControl class]]) {
173+
[(UIControl *)view removeTarget:self action:NULL forControlEvents:UIControlEventAllEvents];
174+
}
175+
170176
// Restore the React Native's overriden behavor for not delaying content touches
171-
UIScrollView *scrollView = [self retrieveScrollView:self.recognizer.view];
177+
UIScrollView *scrollView = [self retrieveScrollView:view];
172178
scrollView.delaysContentTouches = NO;
173179

174180
[super unbindFromView];

0 commit comments

Comments
 (0)