I'm working with ionic 2, and I have a ion-menu on the left side of the app, which keeps closing when I open the menu and touch to the page area.
I'd like to make it to keep opened and to close only when the user explicitly order to close it(via close button, or maybe swiping back, whatever). is there any option or workaround to doing like that?
EDIT: I started with ionic2-starter-sidemenu. when I run it, it looks like:
---------------------------------------------------------------
| | <menuToggle button> |
| |-------------------------------------------------|
| | |
| | |
| /* | |
| side menu | |
| toggled by| |
| menuToggle| /* Content of each Pages */ |
| button | |
| */ | |
| | |
| | |
| | |
---------------------------------------------------------------
and when I click the page content area, the menu closes like this:
---------------------------------------------------------------
| <menuToggle button> |
|-------------------------------------------------------------|
| |
| |
| |
| |
| /* Content of each Pages */ |
| |
| |
| |
| |
| |
---------------------------------------------------------------
I tried reading documentation and searched ionic forum, but found nothing to resolve it.
Here is a quick hack until they release an update:
First:
Remove menuClose
from any of your current side menu buttons
Then in app.component.ts call the MenuController:
constructor(public menuCtrl: MenuController, public platform: Platform) {...
...
initializeApp() {
this.platform.ready().then(() => {
this.menuCtrl.open();
});
}
This does 2 simple behaviors that expose-aside-when did basically:
Hope this answer isn't too late. However ionic 2 now supports the splitplane that works exactly as you described. Its syntax is as:
<ion-split-pane>
<!-- our side menu -->
<ion-menu [content]="content">
<ion-header>
<ion-toolbar>
<ion-title>Menu</ion-title>
</ion-toolbar>
</ion-header>
</ion-menu>
<!-- the main content -->
<ion-nav [root]="root" main #content></ion-nav>
</ion-split-pane>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With