From d85d72d0d9143693f73cef24c8e5bbb4d539a620 Mon Sep 17 00:00:00 2001 From: Nishan Bende Date: Tue, 6 Jul 2021 17:49:23 -0700 Subject: [PATCH] fix: TouchableNativeFeedback ripple starts on previous touch location (#31777) Summary: TouchableNativeFeedback's ripple starts from previous location on subsequent presses. This is similar to https://github.com/facebook/react-native/pull/31669 Fixes https://github.com/facebook/react-native/issues/28944 Issue https://user-images.githubusercontent.com/23293248/123521731-1f375f00-d6d6-11eb-8e4c-fc5ffb322e67.mov Fix https://user-images.githubusercontent.com/23293248/123521735-2bbbb780-d6d6-11eb-88b2-be75342cf22a.mov ## Changelog [Android] [Fixed] - TouchableNativeFeedback ripple starts on previous touch location. Pull Request resolved: https://github.com/facebook/react-native/pull/31777 Test Plan: Tested TouchableNativeFeedback examples in rn-tester app. Registering coordinates before pressed command fixes the issue. Reviewed By: lunaleaps Differential Revision: D29496515 Pulled By: kacieb fbshipit-source-id: 77ac626181a61eee2cd30c4d48e52d10d800f2d8 --- Libraries/Components/Touchable/TouchableNativeFeedback.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Components/Touchable/TouchableNativeFeedback.js b/Libraries/Components/Touchable/TouchableNativeFeedback.js index 8c1ad218fb4..6132f0a6c25 100644 --- a/Libraries/Components/Touchable/TouchableNativeFeedback.js +++ b/Libraries/Components/Touchable/TouchableNativeFeedback.js @@ -183,8 +183,8 @@ class TouchableNativeFeedback extends React.Component { onPress: this.props.onPress, onPressIn: event => { if (Platform.OS === 'android') { - this._dispatchPressedStateChange(true); this._dispatchHotspotUpdate(event); + this._dispatchPressedStateChange(true); } if (this.props.onPressIn != null) { this.props.onPressIn(event);