djett41 / ionic-scroll-sista

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

Scroll Sista stopped working #3

Closed druearmstrong closed 9 years ago

druearmstrong commented 9 years ago

First, thank you for the work on scroll-sista. I have been wanting to implement a shrinking header, actually sub header and was hacking up the code pen shrinking header bar when I ran across your work.

I am not sure why the scroll sister stopped working for me. It worked. Now it doesn't. Is there a bower or node version/issue I am unaware of?

node version: v0.12.7 bower version: 1.4.1

druearmstrong commented 9 years ago

After much research and builds, here are my findings: ionic serve - works! ionic serve --lab - does not work Xcode build - does not work on device

Shinzah commented 9 years ago

Hi, and thank for scroll-sista initiative ! I have the same issue. Sometime it works, and sometime not... I use directive on multiple views, in the same way, and on the first it work, and others not ... Maybe a conflict when the directive is used in multiple views ?

djett41 commented 9 years ago

Thanks guys! What version of ionic UI are you on? If you have a codepen I can look at I can take a look! It seems to work everytime in the demo app I put together so I'm wondering if its conflicting with something in your template? Let me know and I'll try to find a fix thanks!

druearmstrong commented 9 years ago

Thanks for looking into this. Scroll Sista is a great solution and I hope to get this resolved.

Here is the .bower.jason file: "name": "ionic", "version": "1.0.0-rc.5",

Shinzah commented 9 years ago

Hi, i can give you an access to my ionic app webversion. Could you contact me at shin@sw-db.fr, i'll give you login/pwd for the dev version ?

druearmstrong commented 9 years ago

Hi -

Do we have any updates to this issue? Have you been able to get the directive to work on a device? Still waiting for a solution to this issue.

darthdie commented 9 years ago

I was able to get it to work by wrapping the code in "link" with a $timeout. It appears it's having trouble getting the scrolldelegate/view. I'm wondering if it isn't a problem with collection-repeat loading later than the directive? Not sure, haven't had a chance to dig further.

druearmstrong commented 9 years ago

Thanks for looking into the issue. That would make sense for the sporadic working/not working results I'm getting. What is "link" that you wrapped the directive in?

darthdie commented 9 years ago

Ah, sorry! Inside the main scroll sista library/dist/ionic.scroll.sista.js at line 14 is the "link" directive function. So you just then wrap everything in that with a $timeout. Again I can't promise that this will fix it 100% but in my tests it's worked.

druearmstrong commented 9 years ago

@darthdie

Thanks for the detailed follow up. I will try this and let you know how this works out. Did your tests include devices? Thanks again.

druearmstrong commented 9 years ago

@darthdie -

perhaps I am missing something - wrapping the $timeout seems to break the script. Am I not wrapping the $timeout correctly?

return { restrict: 'A', $timeout(function () { link: function($scope, $element, $attr) { ....

darthdie commented 9 years ago

You'd do it like this: https://github.com/darthdie/ionic-scroll-sista/blob/master/dist/ionic.scroll.sista.js

The issue with this method is that there will naturally be a delay before it begins working. The only reliable way I've found for it to work without the delay is to add a scroll-delegate to your ion-content element.

druearmstrong commented 9 years ago

Thanks for clarifying how to wrap the directive in the $timeout method. Well, script is not broken now but I still can't seem to get it to work.

Here's my test screen with a list

```
logo
{{playlist.title}}
```
djett41 commented 9 years ago

from another issue here...

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

druearmstrong commented 9 years ago

While I appreciate the reference, our app will be deployed in 185 countries and all 50 states here. Obviously with such a high end client I can't put a band aid on this issue.

Even with wrapping the timeout within the method, I still don't see a consistent experience. I have til the end of next month to resolve this issue and would really like to feature your work in the app. Is there anything else you see that might be causing the issue?

djett41 commented 9 years ago

I'm going to ask the ionic team if they can add an event we can listen to when the nav bar is finished animating/switching. Because trying to get the active/cached navbar right now is pretty inconsistent. There may be some other hacky ways to accomplish this, but it would be great if we had a sure way of knowing when they navbar is done switching out statuses

druearmstrong commented 9 years ago

That sounds like a solid idea. Really appreciate the willingness for getting behind your directive and working with us for a stable solution.

djett41 commented 9 years ago

@druearmstrong @darthdie @Shinzah This should be fixed now. Just released 1.0.3, and am figured out a way to get the headers correctly

Shinzah commented 9 years ago

Hi, Thank for your work, it work like a charm !

djett41 commented 9 years ago

Great to hear!! I am closing this issue.