From b1c8fa39d6703d42f234a0082a478e4b0925b81e Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Mon, 26 Aug 2019 11:33:11 -0400 Subject: [PATCH] fix(swipe-back): account for negative step values (#19188) fixes #19181 --- core/src/utils/gesture/swipe-back.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/src/utils/gesture/swipe-back.ts b/core/src/utils/gesture/swipe-back.ts index 5c7a96afd6..3ac10df3a3 100644 --- a/core/src/utils/gesture/swipe-back.ts +++ b/core/src/utils/gesture/swipe-back.ts @@ -37,7 +37,13 @@ export const createSwipeBackGesture = ( 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({