Skip to content

Commit f243dea

Browse files
necolastrueadm
authored andcommitted
Add tests for Press responder event module (#15290)
* Add Press responder event tests Behavior being tested takes cues from React Native's Pressability. A couple of these tests fail and require the Press implementation to be patched.
1 parent 296c439 commit f243dea

File tree

2 files changed

+339
-80
lines changed

2 files changed

+339
-80
lines changed

packages/react-events/src/Press.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -86,22 +86,14 @@ function dispatchPressStartEvents(
8686
if ((props.onLongPress || props.onLongPressChange) && !state.isLongPressed) {
8787
const delayLongPress = calculateDelayMS(
8888
props.delayLongPress,
89-
0,
89+
10,
9090
DEFAULT_LONG_PRESS_DELAY_MS,
9191
);
9292

9393
state.longPressTimeout = setTimeout(() => {
9494
state.isLongPressed = true;
9595
state.longPressTimeout = null;
9696

97-
if (
98-
props.onPressChange &&
99-
props.onLongPressShouldCancelPress &&
100-
props.onLongPressShouldCancelPress()
101-
) {
102-
dispatchPressChangeEvent(false);
103-
}
104-
10597
if (props.onLongPress) {
10698
const longPressEventListener = e => {
10799
props.onLongPress(e);

0 commit comments

Comments
 (0)