Skip to content

Conversation

HeyImChris
Copy link

@HeyImChris HeyImChris commented Mar 20, 2020

Please select one of the following

  • I am removing an existing difference between facebook/react-native and microsoft/react-native 👍
  • I am cherry-picking a change from Facebook's react-native into microsoft/react-native 👍
  • [X ] I am making a fix / change for the macOS implementation of react-native
  • I am making a change required for Microsoft usage of react-native

There's a bug where mac os events are received with locations relative to either the screen or the window. Different click styles (light trackpad tap vs. harder trackpad click) appear to dictate which event type we have and thus, which coordinate system we're receiving events in. Right now we were treating every click as if the event location is relative to the window, but we receive some click events relative to the screen. We need to handle those and convert them properly to the right coordinate system.

There's an unknown of why these aren't just MouseDown/MouseUp events. It's possible React Native is gobbling up the OS events somewhere and giving these back, but a search of the repo found no obvious NSEventType manipulation. This did reveal a tangential bug in RNTester where every other mouse down event is throwing an RCTAssert on MacOS which eats up that event. I'm looking into that bug next.

Focus areas to test

  • Soft tap the CommandButton in a downstream app (Polyester) to test dropping a menu at the correct location
  • Click the CommandButton in a downstream app (Polyester) to test dropping a menu at the correct location
  • Tweak the RNTester code so our ActionSheetExample on MacOS passes in an anchor ref we can trigger events off of. From there, soft tap and click a button and verify the menu drops in the correct location
Microsoft Reviewers: Open in CodeFlow

@HeyImChris HeyImChris requested a review from acoates-ms as a code owner March 20, 2020 00:30
@HeyImChris HeyImChris merged commit ba0ccdf into master Mar 20, 2020
@acoates-ms acoates-ms deleted the chrishog/commandButtonPositioning branch April 22, 2020 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants