Skip to content

Commit 91478ed

Browse files
committed
fix(menu): improves menu swipe animation
1 parent 51a492a commit 91478ed

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/animations/animation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ export class Animation {
10161016
if (dur < 0) {
10171017
dur = this._dur;
10181018
}
1019-
this._isAsync = (currentStepValue > 0.05 && currentStepValue < 0.95 && dur > 30);
1019+
this._isAsync = (dur > 30);
10201020

10211021
this._progressEnd(shouldComplete, stepValue, dur, this._isAsync);
10221022

src/components/menu/menu-types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ export class MenuType {
5959
done(isOpen);
6060
}, true);
6161

62-
let dur = this.ani.getDuration() / (Math.abs(velocity) + 1);
62+
let factor = 1 - Math.min(Math.abs(velocity) / 4, 0.7);
63+
let dur = this.ani.getDuration() * factor;
6364

6465
this.ani.progressEnd(shouldComplete, currentStepValue, dur);
6566
}

0 commit comments

Comments
 (0)