Class sub-header stays active after page transition

After I click on my list item(With a subheader) I go to a detail page(Without subheader).
When the transition to the new page is done, the content has been pushed down and show a blank subheader.
After investigation I noticed that the ‘has-subheader’ class is still in the new ion-content class.

What version of Ionic are you using? This was a bug in Beta 1, but I think it is gone now.

If not, setup a CodePen sample for us to take a look at

See this sample with Beta 4.

I have something like this.

In the real project is also have a ng-show on the io-header-bar:

ion-header-bar class="bar-subheader item-input-inset" ng-show="showScoreboardSubNav()">

The desired result is to show a subheader and disable it on other views.

Why don’t you fork my sample and put in your scenario? The sample shows how to make it work. If your’s is significantly differently, you’ll need to give us something to work on.

I did fork it, see this link: http://codepen.io/anon/pen/mKLgf

Oops. Sorry I didn’t notice that.

Here is a working version. It’s a bit of a hack.

It’s using ng-if to definitively remove the subheader from the DOM on the other views. ng-show does not work because Ionic still detects the presence of the header.

This should probably work a bit better though. Ionic could be changed to detect if the subheader is actually visible though.

You might want to open an issue on this.

using ng-if and adding class="has-subheader" to the ion-content has fixed the problem.

Issue is posted: https://github.com/driftyco/ionic/issues/1351

1 Like

It’s using ng-if to definitively remove the subheader from the DOM on the other views. ng-show does not work because Ionic still detects the presence of the header.

That was my problem in different issue ah!!! thx :slight_smile: