Skip to content

Commit

Permalink
fix: TouchableNativeFeedback ripple starts on previous touch location (
Browse files Browse the repository at this point in the history
…#31777)

Summary:
TouchableNativeFeedback's ripple starts from previous location on subsequent presses. This is similar to #31669

Fixes #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

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Android] [Fixed] - TouchableNativeFeedback ripple starts on previous touch location.

Pull Request resolved: #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
  • Loading branch information
intergalacticspacehighway authored and facebook-github-bot committed Jul 7, 2021
1 parent ebe939b commit d85d72d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Libraries/Components/Touchable/TouchableNativeFeedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ class TouchableNativeFeedback extends React.Component<Props, State> {
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);
Expand Down

0 comments on commit d85d72d

Please sign in to comment.