Skip to content

Commit c23c5a4

Browse files
committed
fix(animation): always call onFinish()
1 parent b8b9b83 commit c23c5a4

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

core/src/components/animation-controller/animator.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,9 +1152,6 @@ export class Animator {
11521152
* NO RECURSION
11531153
*/
11541154
_didFinish(hasCompleted: boolean) {
1155-
if (!this.isPlaying) {
1156-
return;
1157-
}
11581155
this.isPlaying = false;
11591156
this.hasCompleted = hasCompleted;
11601157

core/src/components/menu-controller/menu-controller.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ export class MenuController implements MenuControllerI {
182182
* Returns true if any menu is currently animating.
183183
*/
184184
@Method()
185-
async isAnimating(): Promise<boolean> {
186-
return this.menus.some(menu => menu.isAnimating);
185+
isAnimating(): Promise<boolean> {
186+
return Promise.resolve(this.isAnimatingSync());
187187
}
188188

189189
@Method()
@@ -214,7 +214,7 @@ export class MenuController implements MenuControllerI {
214214

215215
@Method()
216216
async _setOpen(menu: MenuI, shouldOpen: boolean, animated: boolean): Promise<boolean> {
217-
if (await this.isAnimating()) {
217+
if (this.isAnimatingSync()) {
218218
return false;
219219
}
220220
if (shouldOpen) {
@@ -248,6 +248,10 @@ export class MenuController implements MenuControllerI {
248248
return this.menus.map(menu => menu.el);
249249
}
250250

251+
isAnimatingSync(): boolean {
252+
return this.menus.some(menu => menu.isAnimating);
253+
}
254+
251255
private registerAnimation(name: string, animation: AnimationBuilder) {
252256
this.menuAnimations.set(name, animation);
253257
}

0 commit comments

Comments
 (0)