File tree Expand file tree Collapse file tree 7 files changed +18
-18
lines changed
packages/react-native-gesture-handler/apple Expand file tree Collapse file tree 7 files changed +18
-18
lines changed Original file line number Diff line number Diff line change 103
103
- (nonnull RNGHUIView *)findViewForEvents ;
104
104
- (BOOL )wantsToAttachDirectlyToView ;
105
105
106
+ - (void )setParentTag : (nonnull NSNumber *)parentTag ;
107
+ - (nonnull NSNumber *)getParentTag ;
108
+
106
109
#if !TARGET_OS_OSX
107
110
- (BOOL )isUIScrollViewPanGestureRecognizer : (nonnull UIGestureRecognizer *)gestureRecognizer ;
108
111
#else
Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ @implementation RNGestureHandler {
76
76
NSArray <NSNumber *> *_simultaneousHandlers;
77
77
RNGHHitSlop _hitSlop;
78
78
uint16_t _eventCoalescingKey;
79
+ NSNumber *_parentTag;
79
80
}
80
81
81
82
- (instancetype )initWithTag : (NSNumber *)tag
@@ -674,4 +675,14 @@ - (BOOL)wantsToAttachDirectlyToView
674
675
return NO ;
675
676
}
676
677
678
+ - (void )setParentTag : (NSNumber *)parentTag
679
+ {
680
+ _parentTag = parentTag;
681
+ }
682
+
683
+ - (NSNumber *)getParentTag
684
+ {
685
+ return _parentTag;
686
+ }
687
+
677
688
@end
Original file line number Diff line number Diff line change @@ -244,7 +244,7 @@ - (void)updateProps:(const Props::Shared &)propsBase oldProps:(const Props::Shar
244
244
// Initialize the vector for a new logic child
245
245
logicChildren[child.viewTag].handlerTags = {};
246
246
logicChildren[child.viewTag].attachedHandlers = [NSMutableSet set ];
247
- [[handlerManager registry ] registerLogicChild : @(child.viewTag) toParent : @(self .tag)];
247
+ [[[ handlerManager registry ] handlerWithTag : @(child.viewTag)] setParentTag : @(self .tag)];
248
248
}
249
249
shouldKeepLogicChild[child.viewTag] = true ;
250
250
[self updatePropsInternal: child.handlerTags
Original file line number Diff line number Diff line change @@ -318,7 +318,7 @@ - (void)sendEvent:(RNGestureHandlerStateChange *)event
318
318
break ;
319
319
}
320
320
case RNGestureHandlerActionTypeLogicDetector: {
321
- NSNumber *parentTag = [_registry getLogicParent: @(detectorView.tag) ];
321
+ NSNumber *parentTag = [[ _registry handlerWithTag: event.handlerTag] getParentTag ];
322
322
RNGHUIView *parentView = [self viewForReactTag: parentTag];
323
323
if ([event isKindOfClass: [RNGestureHandlerEvent class ]]) {
324
324
// TODO: handle forAnimated
Original file line number Diff line number Diff line change 18
18
- (void )detachHandlerWithTag : (nonnull NSNumber *)handlerTag ;
19
19
- (void )dropHandlerWithTag : (nonnull NSNumber *)handlerTag ;
20
20
- (void )dropAllHandlers ;
21
- - (nullable NSNumber *)getLogicParent : (nonnull NSNumber *)child ;
22
- - (void )registerLogicChild : (nonnull NSNumber *)child toParent : (nonnull NSNumber *)parent ;
23
21
@end
Original file line number Diff line number Diff line change 12
12
13
13
@implementation RNGestureHandlerRegistry {
14
14
NSMutableDictionary <NSNumber *, RNGestureHandler *> *_handlers;
15
- NSMutableDictionary <NSNumber *, NSNumber *> *_logicChildMap;
16
15
}
17
16
18
17
- (instancetype )init
19
18
{
20
19
if ((self = [super init ])) {
21
20
_handlers = [NSMutableDictionary new ];
22
- _logicChildMap = [NSMutableDictionary new ];
23
21
}
24
22
return self;
25
23
}
@@ -34,16 +32,6 @@ - (void)registerGestureHandler:(RNGestureHandler *)gestureHandler
34
32
_handlers[gestureHandler.tag] = gestureHandler;
35
33
}
36
34
37
- - (void )registerLogicChild : (NSNumber *)child toParent : (NSNumber *)parent
38
- {
39
- _logicChildMap[child] = parent;
40
- }
41
-
42
- - (NSNumber *)getLogicParent : (NSNumber *)child
43
- {
44
- return _logicChildMap[child];
45
- }
46
-
47
35
- (void )attachHandlerWithTag : (NSNumber *)handlerTag
48
36
toView : (RNGHUIView *)view
49
37
withActionType : (RNGestureHandlerActionType)actionType
Original file line number Diff line number Diff line change @@ -6527,7 +6527,7 @@ __metadata:
6527
6527
jest: "npm:^29.6.3"
6528
6528
prettier: "npm:3.3.3"
6529
6529
react-native-gesture-handler: "workspace:*"
6530
- react-native-reanimated: "npm:^3.18.0 "
6530
+ react-native-reanimated: "npm:^3.19.1 "
6531
6531
react-native-safe-area-context: "npm:^5.4.0"
6532
6532
react-native-screens: "npm:^4.10.0"
6533
6533
react-native-svg: "npm:15.11.2"
@@ -14298,7 +14298,7 @@ __metadata:
14298
14298
languageName: node
14299
14299
linkType: hard
14300
14300
14301
- "react-native-reanimated@npm:^3.18.0":
14301
+ "react-native-reanimated@npm:^3.18.0, react-native-reanimated@npm:^3.19.1 ":
14302
14302
version: 3.19.1
14303
14303
resolution: "react-native-reanimated@npm:3.19.1"
14304
14304
dependencies:
You can’t perform that action at this time.
0 commit comments