From b14471178ef69bbe6902c19572ff4c07173f1e70 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Fri, 24 Jan 2020 15:22:51 -0500 Subject: [PATCH] fix(menu): fix jump when dragging open (#20288) fixes #20286 --- core/src/components/menu/menu.tsx | 4 ++-- core/src/utils/animation/animation.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/components/menu/menu.tsx b/core/src/components/menu/menu.tsx index 1f3ead2df0..71186aac90 100644 --- a/core/src/components/menu/menu.tsx +++ b/core/src/components/menu/menu.tsx @@ -442,7 +442,7 @@ AFTER: * for the cubic bezier curve (at least with web animations) * Not sure if the negative step value is an error or not */ - const adjustedStepValue = (stepValue <= 0) ? 0.01 : stepValue; + const adjustedStepValue = (stepValue < 0) ? 0.01 : stepValue; /** * Animation will be reversed here, so need to @@ -452,7 +452,7 @@ AFTER: * to the new easing curve, as `stepValue` is going to be given * in terms of a linear curve. */ - newStepValue += getTimeGivenProgression([0, 0], [0.4, 0], [0.6, 1], [1, 1], clamp(0, adjustedStepValue, 1))[0]; + newStepValue += getTimeGivenProgression([0, 0], [0.4, 0], [0.6, 1], [1, 1], clamp(0, adjustedStepValue, 0.9999))[0] || 0; const playTo = (this._isOpen) ? !shouldComplete : shouldComplete; diff --git a/core/src/utils/animation/animation.ts b/core/src/utils/animation/animation.ts index fad5b0ea96..889bfbdcb6 100644 --- a/core/src/utils/animation/animation.ts +++ b/core/src/utils/animation/animation.ts @@ -566,7 +566,7 @@ export const createAnimation = (animationId?: string): Animation => { }; const setAnimationStep = (step: number) => { - step = Math.min(Math.max(step, 0), 0.999); + step = Math.min(Math.max(step, 0), 0.9999); if (supportsWebAnimations) { webAnimations.forEach(animation => { animation.currentTime = animation.effect.getComputedTiming().delay + (getDuration() * step);