Skip to content

Commit f8e4b17

Browse files
authored
port (#1863)
1 parent 1473505 commit f8e4b17

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

React/Base/RCTTouchHandler.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ - (void)_updateReactTouchAtIndex:(NSInteger)touchIndex
232232
CGPoint rootViewLocation = [_cachedRootView.window.contentView convertPoint:location toView:_cachedRootView];
233233
NSView *touchView = _touchViews[touchIndex];
234234
CGPoint touchViewLocation = [touchView convertPoint:location fromView:nil];
235+
// JavaScript expects coordinates to have (0,0) at top left, unlike the macOS coordinate system
236+
rootViewLocation.y = NSHeight([[_cachedRootView window] frame]) - rootViewLocation.y;
235237
#endif // macOS]
236238

237239
NSMutableDictionary *reactTouch = _reactTouches[touchIndex];

0 commit comments

Comments
 (0)