djett41 / ionic-scroll-sista

An Ionic plugin that hides the header/tabs while scrolling
MIT License
125 stars 38 forks source link

navigating to another route, previously hidden header will cause problem #2

Closed ghost closed 9 years ago

ghost commented 9 years ago

After hiding the headers/sub-header, ng-click on the list and if it navigate to another page, the previously hidden header will over lap with the new header, it looks very messy.

djett41 commented 9 years ago

Thanks @ukalan so is the issue on state change? Are you navigating to a child state? Or a sibling state? Just want to make sure I'm replicating the issue correctly, it will help for me to fix the issue.

ghost commented 9 years ago

The issue happens to me when I run $state.go('tab.childstate'); It is on the same view of the tab. My code is below, the issue occur when I change state from tab.listjobs to tab.jobdetail. (listjobs is a list of jobs, while the job detail is a view after you tap on the item of the joblist.

.state('tab.listjobs', {
  url: '/listjobs',
  views: {
    'listjobs-tab': {
      templateUrl: 'templates/employee-list.html',
      controller: 'ListCtrl'
    }
  }
})

.state('tab.jobdetail', {
  url: "jobdetail",
  views: {
    'listjobs-tab': {
      templateUrl: "templates/jobDetail.html",
      controller: 'jobdetailCtrl'
    }
  }
})

It seems changing tab is not having the same problem , however, the tabbar, header and sub-header need to be visible (not shrinked) in order to change the tab - which could be the reason that the issue is prevented.

djett41 commented 9 years ago

Ok thanks! I'll take a look at it

djett41 commented 9 years ago

@ukalan I have been looking at this and am trying to find a way to consistently grab the active navbar. The navbar changes to different statuses (active/leaving/staging/cached/entering) not in that exact order, but for some reason it's not grabbing the correct navbar and the cached and active are getting switched. I believe this is the root of most of the issues that are being seen here

ghost commented 9 years ago

I'm not sure what to do to fix it, perhaps as previous said:

$rootScope.$on('$stateChangeSuccess', function (evt, toState) { $ionicHistory.clearCache(); });

The thing is that I remove the code that will scroll the header up and it worked fine, I'm happy to keep the header and hiding the tabs while scrolling, that's what I've been doing in the last weeks.

Perhaps I try this clearCache() trick and report more details.

On Monday, 24 August 2015, Devin Jett notifications@github.com wrote:

@ukalan https://github.com/ukalan I have been looking at this and am trying to find a way to consistently grab the active navbar. The navbar changes to different statuses (active/leaving/staging/cached/entering) not in that exact order, but for some reason it's not grabbing the correct navbar and the cached and active are getting switched. I believe this is the root of most of the issues that are being seen here

— Reply to this email directly or view it on GitHub https://github.com/djett41/ionic-scroll-sista/issues/2#issuecomment-133972308 .

Sent from iPhone - Enjoy the auto-correct mistakes and typos.

djett41 commented 9 years ago

This should be fixed now, try 1.0.3! Thanks