diff --git a/core/src/components/animation-controller/animator.tsx b/core/src/components/animation-controller/animator.tsx index 0d1c0bf1af..5601e85faf 100644 --- a/core/src/components/animation-controller/animator.tsx +++ b/core/src/components/animation-controller/animator.tsx @@ -1152,9 +1152,6 @@ export class Animator { * NO RECURSION */ _didFinish(hasCompleted: boolean) { - if (!this.isPlaying) { - return; - } this.isPlaying = false; this.hasCompleted = hasCompleted; diff --git a/core/src/components/menu-controller/menu-controller.ts b/core/src/components/menu-controller/menu-controller.ts index 849d8c7f22..1d983b5f37 100644 --- a/core/src/components/menu-controller/menu-controller.ts +++ b/core/src/components/menu-controller/menu-controller.ts @@ -182,8 +182,8 @@ export class MenuController implements MenuControllerI { * Returns true if any menu is currently animating. */ @Method() - async isAnimating(): Promise { - return this.menus.some(menu => menu.isAnimating); + isAnimating(): Promise { + return Promise.resolve(this.isAnimatingSync()); } @Method() @@ -214,7 +214,7 @@ export class MenuController implements MenuControllerI { @Method() async _setOpen(menu: MenuI, shouldOpen: boolean, animated: boolean): Promise { - if (await this.isAnimating()) { + if (this.isAnimatingSync()) { return false; } if (shouldOpen) { @@ -248,6 +248,10 @@ export class MenuController implements MenuControllerI { return this.menus.map(menu => menu.el); } + isAnimatingSync(): boolean { + return this.menus.some(menu => menu.isAnimating); + } + private registerAnimation(name: string, animation: AnimationBuilder) { this.menuAnimations.set(name, animation); }