Side Menu View Switching Showing Previous View

I’m very new to this and I’m having an issue I can’t seem to overcome.

When switching between views from the side menu, the view keeps flashing the previous view.
I am using the nav-clear directive, however it appears to not be doing it’s job correctly (Or I’m misunderstanding its functionality).

This is occurring when compiling to iOS 9 on a iPhone 6 via Xcode.
It’s strange as it does not happen in the browser or iOS emulator, with iOS 8.4 or iOS 9.

<ion-list>
	<ion-item nav-clear menu-close href="#/app/home" class="item-icon-left">
		<i class="icon fa fa-home"></i>
		Home
	</ion-item>
	<ion-item nav-clear menu-close href="#/app/calendar" class="item-icon-left">
		<i class="icon fa fa-calendar-o"></i>
		Calendar
	</ion-item>
	<ion-item nav-clear menu-close href="#/app/settings" class="item-icon-left">
		<i class="icon fa fa-cogs"></i>
		Settings
	</ion-item>
</ion-list>

image
Hopefully this screen capture helps!

1 Like

I am seeing the same issue. Any idea?

Can you make a codePen ? It would be useful to help you!

It is just a simplest ionic sidemenu app, and I can reproduce the issue with latest ionic version. Let me know what else do I need to post.

{{ 'MENU' | translate }}

    <ion-item nav-clear menu-close href="#/app/home" id="menu-home">
      {{ "HOME" | translate }}
    </ion-item>
    <ion-item nav-clear menu-close href="#/app/browse"id="menu-browse">
      {{ "BROWSE" | translate }}
    </ion-item>
    <ion-item nav-clear menu-close href="#/app/history" id="menu-history">
      {{ "HISTORY" | translate }}
    </ion-item>
    <ion-item nav-clear menu-close href="#/app/settings" id="menu-settings">
      {{ "SETTINGS" | translate }}
    </ion-item>
    <ion-item nav-clear menu-close href="#/app/about" id="menu-about">
      {{ "ABOUT" | translate }}
    </ion-item>
  </ion-list>
</ion-content>

Catch the click on your menu and link it to :

$ionicHistory.nextViewOptions({disableAnimate: true});

Or put it in your “menu-close” directive.

Thanks for your reply. I too am basing my code off the ‘Side Menu App’. My code is almost identical to @popeztl.

In regards to “catching the click”, I presume you mean using ng-click="menuLink('app.link')" on each menu item? I’ve tried this but the when I return false within the menuLink() function (which stops href from firing), the menu-close directive stops working and the menu remains open.

I’ve also tried leaving href blank and also using href="javascript: return false", neither of which work once building onto iOS. The switching between views seems worse.

I found some code that allows you to edit the menu directive. Is this what you mean by “putting it in your ‘menu-close’ directive”? Or is there another directive I should be using?

Hi @azzamaurice @popeztl & @abellion

I believe this is an iOS 9 issue and can be fixed with this patch. Since install I haven’t been able to replicate the issue :smile:

1 Like

Thx. I also found the same patch last week, and it works for me as well.