Hello,
I’m using the splitpane for my app with the side menu.
Everything works fine on tablets, but on my mobile phone’s, I get a blank screen with no errors or whatever. When I remove the split pane, everything works again. Can someone tell me what is wrong with my code? Running on Android and using Ionic 3.5
<ion-split-pane when="lg">
<ion-menu [content]="content">
<ion-header>
<ion-toolbar>
<ion-title>Menu</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-list>
<button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)">
{{p.title}}
</button>
</ion-list>
</ion-content>
</ion-menu>
<ion-nav [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>
</ion-split-pane>
1 Like
I have to do it like this, otherwise I keep getting a blank white screen on mobile devices:
<!-- Tablet -->
<ion-split-pane *ngIf="platform.is('tablet')">
<ion-menu [content]="content">
<ion-header>
<ion-toolbar>
<ion-title>Menu</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-list>
<button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)">
{{p.title}}
</button>
</ion-list>
</ion-content>
</ion-menu>
<ion-nav [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>
</ion-split-pane>
<!-- Mobile-->
<div *ngIf="!platform.is('tablet')">
<ion-menu [content]="content" >
<ion-header>
<ion-toolbar>
<ion-title>Menu</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-list>
<button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)">
{{p.title}}
</button>
</ion-list>
</ion-content>
</ion-menu>
<ion-nav [root]="rootPage" #content swipeBackEnabled="false" ></ion-nav>
</div>
Edit: doesn’t work in portrait mode on tablets
I compared both HTML files (landscape = working, portrait = blank screen) and the only difference is, that the landscape HTML has the “split-pane-visible” class.
Can you try adding “main” in the ion-nav.
<ion-nav [root]="rootPage" main #content swipeBackEnabled="false"></ion-nav>
As per the docs it is required.
2 Likes
This bug is still alive in the latest version of ionic. In the browser it’s ok.
Thanks, that worked for me!