File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -1152,9 +1152,6 @@ export class Animator {
1152
1152
* NO RECURSION
1153
1153
*/
1154
1154
_didFinish ( hasCompleted : boolean ) {
1155
- if ( ! this . isPlaying ) {
1156
- return ;
1157
- }
1158
1155
this . isPlaying = false ;
1159
1156
this . hasCompleted = hasCompleted ;
1160
1157
Original file line number Diff line number Diff line change @@ -182,8 +182,8 @@ export class MenuController implements MenuControllerI {
182
182
* Returns true if any menu is currently animating.
183
183
*/
184
184
@Method ( )
185
- async isAnimating ( ) : Promise < boolean > {
186
- return this . menus . some ( menu => menu . isAnimating ) ;
185
+ isAnimating ( ) : Promise < boolean > {
186
+ return Promise . resolve ( this . isAnimatingSync ( ) ) ;
187
187
}
188
188
189
189
@Method ( )
@@ -214,7 +214,7 @@ export class MenuController implements MenuControllerI {
214
214
215
215
@Method ( )
216
216
async _setOpen ( menu : MenuI , shouldOpen : boolean , animated : boolean ) : Promise < boolean > {
217
- if ( await this . isAnimating ( ) ) {
217
+ if ( this . isAnimatingSync ( ) ) {
218
218
return false ;
219
219
}
220
220
if ( shouldOpen ) {
@@ -248,6 +248,10 @@ export class MenuController implements MenuControllerI {
248
248
return this . menus . map ( menu => menu . el ) ;
249
249
}
250
250
251
+ isAnimatingSync ( ) : boolean {
252
+ return this . menus . some ( menu => menu . isAnimating ) ;
253
+ }
254
+
251
255
private registerAnimation ( name : string , animation : AnimationBuilder ) {
252
256
this . menuAnimations . set ( name , animation ) ;
253
257
}
You can’t perform that action at this time.
0 commit comments