Skip to content

Commit

Permalink
Patch Press responder event module to pass tests
Browse files Browse the repository at this point in the history
  • Loading branch information
necolas committed Apr 1, 2019
1 parent 631d212 commit 40462ad
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 @@ -64,20 +64,12 @@ function dispatchPressStartEvents(
dispatchPressChangeEvent(true);
}
if ((props.onLongPress || props.onLongPressChange) && !state.isLongPressed) {
const delayLongPress = calculateDelayMS(props.delayLongPress, 0, 1000);
const delayLongPress = calculateDelayMS(props.delayLongPress, 10, 1000);

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 40462ad

Please sign in to comment.