Skip to content

bug: ionic angular 7.5, cannot access menus with menuController #28337

Description

@rvcroffi

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

After upgrade @ionic/angular from 7.4.4 to 7.5.0 MenuController.enable() stop working.

Expected Behavior

A menu initially disabled should be enabled after calling enable(true) from MenuController on app.component.ts.

Steps to Reproduce

  1. Create a new Ionic sidemenu app (angular).
  2. Run npm i @ionic/angular@7.4.4
  3. Disable ion-menu on app.component.html <ion-menu contentId="main-content" type="overlay" [disabled]="true">
  4. Enable the menu on app.component.ts when platform is ready:
constructor(private menuCtrl: MenuController, private platform: Platform) {
    this.platform.ready().then(() => {
      this.menuCtrl.enable(true);
    });
  }
  1. Run ionic serve and you will see the menu enabled (as expected).
  2. Stop ionic serve and run npm i @ionic/angular@7.5.0
  3. Run ionic serve again and the menu will be disabled.

Code Reproduction URL

https://stackblitz.com/edit/angular-lgwu3i?file=src%2Fapp%2Fapp.component.ts

Ionic Info

Ionic:

Ionic CLI : 7.1.1
Ionic Framework : @ionic/angular 7.5.0
@angular-devkit/build-angular : 16.2.6
@angular-devkit/schematics : 16.2.6
@angular/cli : 16.2.6
@ionic/angular-toolkit : 9.0.0

Capacitor:

Capacitor CLI : 5.5.0
@capacitor/android : not installed
@capacitor/core : 5.5.0
@capacitor/ios : not installed

Utility:

cordova-res : 0.15.4
native-run : 1.7.3

System:

NodeJS : v18.16.0 (C:\Program Files\nodejs\node.exe)
npm : 9.6.7
OS : Windows 10

Additional Information

No response

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