Hey, I just created a new app with side-menu template, and I encountered a problem that closing the sidemen is only done by swipe, not by taping or clicking the menu. Is this a bug or not implemented ?
Not sure but is it not the difference between an iOS and Android menu? Like for one type it doesnāt close thatās the behavior and for the other it does?
Iām not sure anymore. I define the use of menuType: 'overlay' in app.module.ts to have the same behavior on both type of devices. Just quickly tested, I was able to close the menu by clicking outside of it
IonicModule.forRoot({
menuType: 'overlay'
}
Iām not sure if @moda20 means opening/closing the menu via MenuController.enable or not but it is no longer working for me in Ionic4.
this.menuCtrl.enable(true)
I forgot to mention - on devices. It works in desktop browsers.
My this.menuCtrl.enable not working might be for another reason. I ran out of time today for further testing.
@moda20, Iām not sure this is on track with what you asking about but Iāll this here anyways.
In Ionic3 I could use this.menuCtrl.enable(true/false); to open/close the menu anywhere anytime on both devices and desktop.
In Ionic 4 I find I need to determine if the app is running on a device or desktop first and then call one of these two functions respectively.
if(isDevice){
this.menuCtrl.open();
}else{
this.menuCtrl.enable(this.menuOpen);
}
So, on a device, I now use this.menuCtrl.open();
Alas, there is currently an issue with detecting if it is a device accurately.
https://forum.ionicframework.com/t/how-to-detect-platform-using-ionic-4/138189
Thanks for seeing this, but the problem was with Just safari. On computer safari browser, it doesnāt close when clicking outside the menu. On the other hand in Chrome and on android it does close.
what do you mean with ācloseā
close like āclick on the hamburger button to display (open) it and then click outside to hide (close) itā
or
close like āusing the menu controller to disable the menuā
in any case, just tested, works fine in Safari for me
do you have set another menu type than overlay?
Use menuCtrl in ts file in ionic 4
ā¦
import { MenuController } from ā@ionic/angularā;
ā¦
constructor(private menu: MenuController) {
}
ā¦
openEnd() {
this.menu.close();
}
Hi,
I am facing the similar issueā¦on the event of the menuitem click i am closing the menu but it doesnāt seems to be working.
The ionic version is 5.4.4
on such a small thing the issue is there.I wish i would have started the project in xamarinā¦Hamburger behavior is very inconsistent.itās working on few devices and it,s not not working on some of the device.If feature like hamburger will be that incosistent then how come anybody can proceed in development.Really having tough time for solving this clueless IONIC bug
Thanks. this saved my time

Do you use ion-menu-toggle inside your ion-list ?
If you donāt write ion-menu-toggle the menu will be still visible after item click.

