Skip to content

bug: ASSERT: can not be animating in menuController.swipeGesture(false, 'main') #19000

Description

@Yomyer

Bug Report

Ionic Info
Run ionic info from a terminal/cmd prompt and paste the output below.

Ionic:

   ionic (Ionic CLI)             : 4.12.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.7.1
   @angular-devkit/build-angular : 0.802.0
   @angular-devkit/schematics    : 8.2.0
   @angular/cli                  : 8.2.0
   @ionic/angular-toolkit        : 2.0.0

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : browser 5.0.4, ios 5.0.0
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.0.1, (and 23 other plugins)

System:

   Android SDK Tools : 26.1.1 (/Users/yerko/Library/Android/sdk)
   ios-deploy        : 1.9.4
   ios-sim           : 7.0.0
   NodeJS            : v10.15.2 (/usr/local/Cellar/node@10/10.15.2_1/bin/node)
   npm               : 6.4.1
   OS                : macOS High Sierra
   Xcode             : Xcode 10.1 Build version 10B61

Describe the Bug

It only happens when I try to off the swipeGesture. I have tried it in several ways:

await this.menuCtrl.swipeGesture(false, 'main');

document.querySelector('ion-menu-controller').swipeGesture(false, 'main')

this.menuCtrl.get('main').then((menu: HTMLIonMenuElement) => {
   menu.swipeGesture = true;
});

But all with the same result.

ASSERT: can not be animating

This is the part of the code I use, in previous versions it worked perfectly.
Basically what it does is that when the modal opens, it closes the menu (if it is open) and doesn't let it swipe so that it doesn't reopen unintentionally when the user is navigating through the modal.

       this.current = await this.modalCtrl.create(options);

       await this.menuCtrl.swipeGesture(false, 'main');

       this.current.present();

       this.current.onWillDismiss().then(async response => {
            await this.menuCtrl.swipeGesture(true, 'main');
       });

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions