Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[beta.11] Initial hiding of the sidemenu doesn't work without timeout #15727

Closed
sasos90 opened this issue Sep 23, 2018 · 1 comment
Closed

[beta.11] Initial hiding of the sidemenu doesn't work without timeout #15727

sasos90 opened this issue Sep 23, 2018 · 1 comment
Assignees

Comments

@sasos90
Copy link

sasos90 commented Sep 23, 2018

Bug Report

Ionic Info

Ionic:

   ionic (Ionic CLI)          : 4.1.2 (C:\Users\****\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework            : @ionic/angular 4.0.0-beta.11
   @angular-devkit/core       : 0.7.5
   @angular-devkit/schematics : 0.7.5
   @angular/cli               : 6.1.5
   @ionic/ng-toolkit          : 1.0.8
   @ionic/schematics-angular  : 1.0.6

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.0.0
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 2.1.4, (and 7 other plugins)

System:

   Android SDK Tools : 26.1.1 (C:\Users\****\AppData\Local\Android\Sdk)
   NodeJS            : v8.11.2 (C:\Program Files\nodejs\node.exe)
   npm               : 6.1.0
   OS                : Windows 10

Describe the Bug
My application starts with the login screen without the side menu being shown. After a successful login, the menu should appear. At the AppComponent level, I check the token, and if it's not set, I redirect to LoginComponent. At login component I try to hide the menu with MenuController, inside of the ionViewDidEnter lifecycle method.
So the menu doesn't hide on this way:

    ionViewDidEnter() {
        this.menuController.enable(false);
    }

but hides if I put 25ms of timeout

    ionViewDidEnter() {
        setTimeout(() => {
            this.menuController.enable(false);
        }, 25);
    }

I also tried the ionViewWillEnter but I have to increase the timeout obviously.

Steps to Reproduce
Steps to reproduce the behavior:

  1. Try to hide the menu from initial component with a help of MenuController.
  2. Refresh the page and the menu will not be hidden.

Expected Behavior
The menu should not be shown when you hide it with MenuController on initial start of the application.

@ionitron-bot ionitron-bot bot added the triage label Sep 23, 2018
@ionitron-bot ionitron-bot bot removed the triage label Sep 25, 2018
@manucorporat manucorporat self-assigned this Oct 1, 2018
@ionitron-bot
Copy link

ionitron-bot bot commented Oct 31, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Oct 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants