-
Notifications
You must be signed in to change notification settings - Fork 151
Fix coordinates of touch.pageX/pageY coordinates when RCTRootView is not at the origin of the NSWindow #1619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…iew." This reverts commit 5a67ae0.
…not at the origin of the NSWindow
Saadnajmi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix! Let me know if you need this merged if you don't have merge permissions. Also if it needs to be back ported.
|
Thanks @Saadnajmi ! Yes, this should be back ported to .68 -- the version currently deployed in Office, and any newer version that may be being prepared for deployment. |
We're currently doing the 71 merge on the main branch, so you should only need to make one more PR to 0.68-stable (we're skipping 0.69 and 0.70). |
…not at the origin of the NSWindow (microsoft#1619) * Update scripts to publish react-native-macos-init * Clean up merge markers * Restored ios:macos RNTester parity except for InputAccessoryView. * Revert "Restored ios:macos RNTester parity except for InputAccessoryView." This reverts commit 5a67ae0. * Remove unnecessary android builds and tar file upload. * Fix coordinates of touch.pageX/pageY coordinates when RCTRootView is not at the origin of the NSWindow Co-authored-by: React-Native Bot <53619745+rnbot@users.noreply.github.com>
Please select one of the following
Summary
If the
RCTRootViewis not positioned at the origin of theNSWindow, thentouch.pageX/pageYevents will not have the correct coordinates. This can make it difficult for a user to click onTouchableandPressablecomponents unless there are no mouse moves between the mouse down and the mouse up events. The touch down and up events use thetouch.locationX/locationYwhich are computed correctly, but after a touch down if the user move the mouse thetouch.pageX/pageYcoordinates are used and if theRCTRootViewis not at the window origin, these coordinates will be offset. The result is the user will see touch feedback for a moment and then it disappears.Changelog
[macOS] [Fixed] - Fix coordinates of touch.pageX/pageY coordinates when RCTRootView is not at the origin of the NSWindow
Test Plan
This issue only manifests if the
RCTRootViewis not at the origin of theNSWindow. To test this bug, I modifiedpackages/rn-tester/RNTester-macOS/ViewController.madding[rootView setFrameOrigin:(NSPoint){0,-100}];at the end ofviewDidLoad.In the "Pressable" page, click on the first "Press Me" button and notice that it correctly changes to "Pressed!" back to "Press Me" if the mouse is dragged out of the Pressable.
This resolved #1618