fix(swipe-back): account for negative step values (#19188)

fixes #19181
This commit is contained in:
Liam DeBeasi
2019-08-26 11:33:11 -04:00
committed by GitHub
parent fa958a5764
commit b1c8fa39d6

View File

@ -37,7 +37,13 @@ export const createSwipeBackGesture = (
realDur = Math.min(dur, 540); realDur = Math.min(dur, 540);
} }
onEndHandler(shouldComplete, stepValue, realDur); /**
* TODO: stepValue can sometimes return a negative
* value, but you can't have a negative time value
* for the cubic bezier curve (at least with web animations)
* Not sure if the negative step value is an error or not
*/
onEndHandler(shouldComplete, (stepValue <= 0) ? 0.01 : stepValue, realDur);
}; };
return createGesture({ return createGesture({