I was playing around with the ionic sidemenu seed project and noticed an issue with the back button getting dropped during navigation.
Here’s the steps to reproduce after load:
Click the menu toggle in the nav bar.
Click on playlists
Click on a playlist.
If you just clicked on a playlist normally, the back button would show. Opening the menu first causes it to stay hidden. It looks like this is caused by having nav-clear in the menu items, which works for other items, but clicking on the same item causes the nav state to get cleared and never recreated since the menu just toggles closed.
Curious if there’s a workaround for this or if it’s just a bug.
Hm… It seems it also happens most frequently when you QUICKLY click on one of the list items. If you open the menu, tap “Playlists” and wait a sec THEN tap the list, you get the back button. however, this isn’t always the case.
Here’s a sample GIF of the problem in action for other’s to understand without setting up the project.
However, I’m not really sure that it’s a bug. The real question is “Why is the nav-clear on those menu items in the first place.?”
Nav-clear means “listen for the next state change and then blow out all history”. That’s exactly what’s happening.
I think it would just be more appropriate to NOT have the nav-clear on anything but a “Home” link in the menu.
The issue with removing nav-clear from those link is that the back button now sticks around when you click menu items. This behavior is a little odd since the clicking back goes back to the original menu items view. In reality, you’d want the back button cleared and a new history to start every time a menu item is clicked.
This also get you so very strange animation effect since the new view that comes in after clicking a menu item slides in when you really want it just to appear.