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.24k stars 429 forks source link

Clear touch handler states when gesture recognizer ended. #128

Closed beretboat closed 7 years ago

beretboat commented 7 years ago

In RCTTouchHandler, touch states are removed in -[RCTTouchHandler _recordRemovedTouches:], which is called in -[RCTTouchHandler mouseUp:]. The problem is -[RCTTouchHandler mouseUp:] is not guaranteed to be called, and when it's not, the touch states would be wrong.

So, correct me if I was wrong, I think touch states need to be cleared some where, and I think -[NSGestureRecognizer reset] might be the right place.

ptmt commented 7 years ago

Looks good to me, let's test in the wild in 0.11 rc3. Sorry for failed test, too many Flow errors.

beretboat commented 7 years ago

Thanks!