ptmt / react-native-macos

[deprecated in favor of https://microsoft.github.io/react-native-windows/] React Native for macOS is an experimental fork for writing desktop apps using Cocoa
MIT License
11.25k stars 429 forks source link

Improved input handling #228

Open aleclarson opened 5 years ago

aleclarson commented 5 years ago

Add the RCTWindow class that improves upon the current input handling logic.

Users can opt-in by using RCTWindow in place of NSWindow. If they don't, they'll continue to use the (flawed) RCTTouchHandler logic.

Event handling in RCTWindow is different in the following ways:

In the future, I might try updating RCTTouchHandler with the same logic that RCTWindow has. That's what I tried originally, but I ran into issues between NSGestureRecognizer and NSTextView.

Other changes

In the future, I might implement the mouseEnter and mouseLeave events properly (using the JS event system).