Skip to content

Commit c4064f9

Browse files
authored
[iOS] Check if enableTrackpadTwoFingerGesture is nil before applying (#4349)
## Description On `iOS`, `enableTrackpadTwoFingerGesture` was read in `RNPanGestureHandler`'s `updateConfig:` without checking whether the key is present in the config, and `allowedScrollTypesMask` was only ever set when the value was truthy. This PR changes it to match other props behavior. ## Test plan Checked that basic-example builds correctly
1 parent ef120cd commit c4064f9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/react-native-gesture-handler/apple/Handlers/RNPanHandler.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,9 +408,9 @@ - (void)updateConfig:(NSDictionary *)config
408408
APPLY_FLOAT_PROP(failOffsetYEnd);
409409

410410
#if !TARGET_OS_OSX && !TARGET_OS_TV
411-
bool enableTrackpadTwoFingerGesture = [RCTConvert BOOL:config[@"enableTrackpadTwoFingerGesture"]];
412-
if (enableTrackpadTwoFingerGesture) {
413-
recognizer.allowedScrollTypesMask = UIScrollTypeMaskAll;
411+
id enableTrackpadTwoFingerGesture = config[@"enableTrackpadTwoFingerGesture"];
412+
if (enableTrackpadTwoFingerGesture != nil) {
413+
recognizer.allowedScrollTypesMask = [RCTConvert BOOL:enableTrackpadTwoFingerGesture] ? UIScrollTypeMaskAll : 0;
414414
}
415415

416416
APPLY_NAMED_INT_PROP(minimumNumberOfTouches, @"minPointers");

0 commit comments

Comments
 (0)