Prevent side menu from closing when click

Hi, I there a way to prevent sidemenu from closing everytime i click on it. I want to programmatically close the menu instead of automatic. I’ve tried but it doesn’t work:

<ion-menu id='mainMenu' [content]="content">
    <ion-toolbar color="primary">


      <ion-item menuClose ion-item *ngFor="let menu of menus; let i = index;" (click)="openSubmenu(i)">
        <ion-list *ngIf="i==activeMenuIndex">
          <ion-item menuClose ion-item *ngFor="let submenu of menu.submenu;" (click)="openMenuItem(submenu)">



<!-- Disable swipe-to-go-back because it's poor UX to combine STGB with side menus -->
<ion-nav [root]="rootPage" #content swipeBackEnabled="false" ></ion-nav>

and here’s on my .ts

openSubmenu(i) {
    this.activeMenuIndex = i;;

I got it working! I just need to remove the menuClose on the

Can’t do this on ionic 4. Did someone have another solution? Thanks.

1 Like