Skip to content

Commit 0013156

Browse files
committed
fix relations
1 parent d76522f commit 0013156

File tree

7 files changed

+16
-15
lines changed

7 files changed

+16
-15
lines changed

packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,6 @@ class RNGestureHandlerModule(reactContext: ReactApplicationContext?) :
9898
val factory = RNGestureHandlerFactoryUtil.findFactoryForHandler<GestureHandler>(handler) ?: return
9999

100100
factory.setConfig(handler, config)
101-
102-
if (handler.actionType != GestureHandler.ACTION_TYPE_NATIVE_DETECTOR) {
103-
interactionManager.dropRelationsForHandlerWithTag(handlerTag)
104-
interactionManager.configureInteractions(handler, config)
105-
}
106101
}
107102

108103
@ReactMethod

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,6 @@ - (void)updateConfig:(NSDictionary *)config
182182
RCTLogError(@"Cannot have all of top, bottom and height defined");
183183
}
184184
}
185-
186-
if (_actionType != RNGestureHandlerActionTypeNativeDetector) {
187-
[self updateRelations:config];
188-
}
189185
}
190186

191187
- (void)updateRelations:(NSDictionary *)relations

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,9 @@ - (void)updateGestureHandlerConfig:(double)handlerTag newConfig:(NSDictionary *)
161161

162162
- (void)configureRelations:(double)handlerTag relations:(NSDictionary *)relations
163163
{
164-
RNGestureHandlerManager *manager = [RNGestureHandlerModule handlerManagerForModuleId:_moduleId];
165-
[manager updateGestureHandlerRelations:[NSNumber numberWithDouble:handlerTag] relations:relations];
164+
[self addOperationBlock:^(RNGestureHandlerManager *manager) {
165+
[manager updateGestureHandlerRelations:[NSNumber numberWithDouble:handlerTag] relations:relations];
166+
}];
166167
}
167168

168169
- (void)dropGestureHandler:(double)handlerTag

packages/react-native-gesture-handler/src/handlers/createHandler.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,9 @@ export default function createHandler<
405405
this.handlerTag,
406406
newConfig
407407
);
408+
409+
RNGestureHandlerModule.configureRelations(this.handlerTag, newConfig);
410+
408411
scheduleFlushOperations();
409412
};
410413

packages/react-native-gesture-handler/src/handlers/gestures/GestureDetector/attachHandlers.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ export function attachHandlers({
6969
extractGestureRelations(handler)
7070
)
7171
);
72+
73+
RNGestureHandlerModule.configureRelations(
74+
handler.handlerTag,
75+
extractGestureRelations(handler)
76+
);
7277
}
7378

7479
scheduleFlushOperations();

packages/react-native-gesture-handler/src/handlers/gestures/GestureDetector/updateHandlers.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ export function updateHandlers(
7474
)
7575
);
7676

77+
RNGestureHandlerModule.configureRelations(
78+
handler.handlerTag,
79+
extractGestureRelations(handler)
80+
);
81+
7782
registerHandler(handler.handlerTag, handler, handler.config.testId);
7883
}
7984

packages/react-native-gesture-handler/src/web/handlers/GestureHandler.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -764,10 +764,6 @@ export default abstract class GestureHandler implements IGestureHandler {
764764
this._userSelect = config.userSelect;
765765
}
766766

767-
if (this.actionType !== ActionType.NATIVE_DETECTOR) {
768-
InteractionManager.instance.configureInteractions(this, config);
769-
}
770-
771767
if (this.enabled) {
772768
return;
773769
}

0 commit comments

Comments
 (0)