From 07140cf2c5585e2177c2b2e8dc09e3671afcd1b6 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Tue, 3 Sep 2019 12:02:22 -0400 Subject: [PATCH] stop menu animation when closed (#19234) fixes #19203 --- core/src/components/menu/menu.tsx | 8 +++++--- core/src/utils/animation/animation.ts | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/core/src/components/menu/menu.tsx b/core/src/components/menu/menu.tsx index f085484dd6..7bd482e781 100644 --- a/core/src/components/menu/menu.tsx +++ b/core/src/components/menu/menu.tsx @@ -379,9 +379,7 @@ export class Menu implements ComponentInterface, MenuI { const delta = computeDelta(detail.deltaX, this._isOpen, this.isEndSide); const stepValue = delta / this.width; - this.animation - - .progressStep(stepValue); + this.animation.progressStep(stepValue); } private onEnd(detail: GestureDetail) { @@ -491,6 +489,10 @@ export class Menu implements ComponentInterface, MenuI { this.backdropEl.classList.remove(SHOW_BACKDROP); } + if (this.animation) { + this.animation.stop(); + } + // emit close event this.ionDidClose.emit(); } diff --git a/core/src/utils/animation/animation.ts b/core/src/utils/animation/animation.ts index 31c3f579eb..8aca4c692b 100644 --- a/core/src/utils/animation/animation.ts +++ b/core/src/utils/animation/animation.ts @@ -1031,7 +1031,7 @@ export const createAnimation = () => { }); if (initialized) { - cleanUp(); + cleanUpElements(); initialized = false; }