react-native-gesture-handler
react-native-gesture-handler copied to clipboard
Memoize tap GH state for sending proper value after releasing finger
Motivation
Issue happens on iOS. https://github.com/kmagiera/react-native-gesture-handler/issues/476.
After releasing finger in tap GH which is waiting for second GH and failure of second GH, values are being set zero and then zeros are send to JS instead on corrects values.
Changes
After reseting values are memoized and placed in nativeEvent. If this kind of situation is detected (no finger on screen) we fallback to memoized valued values instead of evaluating them.
@kmagiera i think i fixed this the way you wanted. I actually use your Native code for a Nativescript module. Here is the commit if that is of any interest to you https://github.com/Akylas/nativescript-gesturehandler/commit/6c3ed76e958660ea83364f1e3e9e6fcef8e7a43b
This looks more like how I'd imagine. Thanks for sending @farfromrefug. Willing to send a PR with this change maybe?
@kmagiera sorry i dont use your code nor react-native
@kmagiera @jakub-gonet I can apply changes that @farfromrefug proposed. Is it still relevant?