mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(animation): always call onFinish()
This commit is contained in:
@@ -182,8 +182,8 @@ export class MenuController implements MenuControllerI {
|
||||
* Returns true if any menu is currently animating.
|
||||
*/
|
||||
@Method()
|
||||
async isAnimating(): Promise<boolean> {
|
||||
return this.menus.some(menu => menu.isAnimating);
|
||||
isAnimating(): Promise<boolean> {
|
||||
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<boolean> {
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user