Memoize tap GH state for sending proper value after releasing finger#478
Memoize tap GH state for sending proper value after releasing finger#478
Conversation
kmagiera
left a comment
There was a problem hiding this comment.
I'd prefer if we always use memoized value for the event and memoize it in a place where we are certain the values are right. I'm not certain that the conditions you added in eventExtraData are going to work at all times (e.g. could there be a case that numberOfTouches is zero but the code where we memoize hasn't been triggered?)
|
@kmagiera i think i fixed this the way you wanted. |
|
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. |
|
I'm closing this PR as the issue no longer persists on v2 and v3. Let me know if this should be reopened. |
Motivation
Issue happens on iOS. #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.