Skip to content

Commit 961b00d

Browse files
Pressable ripple should pick press event coordinates on subsequent press. (#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
1 parent 4b9d9dd commit 961b00d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Libraries/Components/Pressable/useAndroidRippleForView.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ export default function useAndroidRippleForView(
7474
onPressIn(event: PressEvent): void {
7575
const view = viewRef.current;
7676
if (view != null) {
77-
Commands.setPressed(view, true);
7877
Commands.hotspotUpdate(
7978
view,
8079
event.nativeEvent.locationX ?? 0,
8180
event.nativeEvent.locationY ?? 0,
8281
);
82+
Commands.setPressed(view, true);
8383
}
8484
},
8585
onPressMove(event: PressEvent): void {

0 commit comments

Comments
 (0)