fix(menu): fix jump when dragging open (#20288)

fixes #20286
This commit is contained in:
Liam DeBeasi
2020-01-24 15:22:51 -05:00
committed by GitHub
parent 09d951ae1b
commit b14471178e
2 changed files with 3 additions and 3 deletions

View File

@ -442,7 +442,7 @@ AFTER:
* for the cubic bezier curve (at least with web animations) * for the cubic bezier curve (at least with web animations)
* Not sure if the negative step value is an error or not * 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 * 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 * to the new easing curve, as `stepValue` is going to be given
* in terms of a linear curve. * 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; const playTo = (this._isOpen) ? !shouldComplete : shouldComplete;

View File

@ -566,7 +566,7 @@ export const createAnimation = (animationId?: string): Animation => {
}; };
const setAnimationStep = (step: number) => { const setAnimationStep = (step: number) => {
step = Math.min(Math.max(step, 0), 0.999); step = Math.min(Math.max(step, 0), 0.9999);
if (supportsWebAnimations) { if (supportsWebAnimations) {
webAnimations.forEach(animation => { webAnimations.forEach(animation => {
animation.currentTime = animation.effect.getComputedTiming().delay + (getDuration() * step); animation.currentTime = animation.effect.getComputedTiming().delay + (getDuration() * step);