Skip to content

Commit

Permalink
Pressable ripple should pick press event coordinates on subsequent pr…
Browse files Browse the repository at this point in the history
…ess. (#31669)

Summary:
Please watch the recording below for better explanation. Ripple effect starts from previous press event's coordinates on subsequent presses.

https://user-images.githubusercontent.com/23293248/120929850-51bdef80-c708-11eb-906c-d711672370ee.mov

## Changelog

[Android] [Fixed] - Pressable ripple subsequent press coordinates.

Pull Request resolved: #31669

Test Plan:
- Tested all Pressable examples. Registering coordinates before press seems to fix the issue.

https://user-images.githubusercontent.com/23293248/120929905-892c9c00-c708-11eb-9e63-576ae800733c.mov

Reviewed By: yungsters

Differential Revision: D28966505

Pulled By: kacieb

fbshipit-source-id: b745180065611390e1897692a0bdea7d6e022cdd
  • Loading branch information
intergalacticspacehighway authored and facebook-github-bot committed Jun 8, 2021
1 parent 4b9d9dd commit 961b00d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Libraries/Components/Pressable/useAndroidRippleForView.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ export default function useAndroidRippleForView(
onPressIn(event: PressEvent): void {
const view = viewRef.current;
if (view != null) {
Commands.setPressed(view, true);
Commands.hotspotUpdate(
view,
event.nativeEvent.locationX ?? 0,
event.nativeEvent.locationY ?? 0,
);
Commands.setPressed(view, true);
}
},
onPressMove(event: PressEvent): void {
Expand Down

0 comments on commit 961b00d

Please sign in to comment.