Skip to content

Commit

Permalink
Patch Press responder event module to pass tests
Browse files Browse the repository at this point in the history
Ref #15257
  • Loading branch information
necolas committed Apr 2, 2019
1 parent e128969 commit 0d4127c
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions packages/react-events/src/Press.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,14 @@ function dispatchPressStartEvents(
if ((props.onLongPress || props.onLongPressChange) && !state.isLongPressed) {
const delayLongPress = calculateDelayMS(
props.delayLongPress,
0,
10,
DEFAULT_LONG_PRESS_DELAY_MS,
);

state.longPressTimeout = setTimeout(() => {
state.isLongPressed = true;
state.longPressTimeout = null;

if (
props.onPressChange &&
props.onLongPressShouldCancelPress &&
props.onLongPressShouldCancelPress()
) {
dispatchPressChangeEvent(false);
}

if (props.onLongPress) {
const longPressEventListener = e => {
props.onLongPress(e);
Expand Down

0 comments on commit 0d4127c

Please sign in to comment.