diff --git a/apple/RNGestureHandlerPointerTracker.m b/apple/RNGestureHandlerPointerTracker.m index acb242790f..2bef5e5d40 100644 --- a/apple/RNGestureHandlerPointerTracker.m +++ b/apple/RNGestureHandlerPointerTracker.m @@ -71,8 +71,10 @@ - (int)registeredTouchesCount - (NSDictionary *)extractPointerData:(int)index forTouch:(RNGHUITouch *)touch { #if TARGET_OS_OSX - CGPoint absolutePos = [touch locationInWindow]; - CGPoint relativePos = [touch.window.contentView convertPoint:absolutePos fromView:_gestureHandler.recognizer.view]; + CGFloat windowHeight = touch.window.contentView.frame.size.height; + CGPoint yFlippedAbsolutePos = [touch locationInWindow]; + CGPoint absolutePos = CGPointMake(yFlippedAbsolutePos.x, windowHeight - yFlippedAbsolutePos.y); + CGPoint relativePos = [_gestureHandler.recognizer.view convertPoint:absolutePos fromView:touch.window.contentView]; #else CGPoint relativePos = [touch locationInView:_gestureHandler.recognizer.view]; CGPoint absolutePos = [touch locationInView:_gestureHandler.recognizer.view.window]; diff --git a/src/components/Pressable/Pressable.tsx b/src/components/Pressable/Pressable.tsx index ccb80436ad..4518e20fc2 100644 --- a/src/components/Pressable/Pressable.tsx +++ b/src/components/Pressable/Pressable.tsx @@ -302,7 +302,7 @@ export default function Pressable(props: PressableProps) { Gesture.Native() .onBegin(() => { // Android sets BEGAN state on press down - if (Platform.OS === 'android') { + if (Platform.OS === 'android' || Platform.OS === 'macos') { isTouchPropagationAllowed.current = true; } }) @@ -358,11 +358,7 @@ export default function Pressable(props: PressableProps) { gesture.enabled(isPressableEnabled); gesture.runOnJS(true); gesture.hitSlop(appliedHitSlop); - gesture.shouldCancelWhenOutside(false); - - if (Platform.OS !== 'web') { - gesture.shouldCancelWhenOutside(true); - } + gesture.shouldCancelWhenOutside(Platform.OS === 'web' ? false : true); } // Uses different hitSlop, to activate on hitSlop area instead of pressRetentionOffset area