harm-less / angular-sticky

Pure javascript AngularJS directive to make elements stick when scrolling
http://harm-less.github.io/angular-sticky
83 stars 38 forks source link

layout breaks when using ng-show #19

Closed daniel-halldorsson closed 8 years ago

daniel-halldorsson commented 8 years ago

When using ng-show on an element that also has hl-sticky my content appears fixed to the top left of the page upon ng-show being set to true. If i do not use ng-show then all works as expected and looks great

daniel-halldorsson commented 8 years ago

fyi: i solved for my use case by putting the hl-sticky on a containing div and the ng-show on another div inside it but may not be suitable for all cases.

harm-less commented 8 years ago

Interesting case, I don't think I tried this before. Perhaps it's also fixed if you use ng-if instead of an ng-show? One other thing you could try is this (look for enable). But from the sound of it, you want to make the element invisible. You could try a ng-show in combination with enable, but that seems like overkill.

That's all I can think of right now. Let me know if you need any more help with this.

daniel-halldorsson commented 8 years ago

thanks again for quick reply. can confirm it works if using ng-if instead of ng-show.

ng-show combined with enable did not work.

ng-if works fine and there are work arounds for ng-show so not a major show stopper but just a little niggle.

cheers, awesome library :)

harm-less commented 8 years ago

If you're not switching the ng-if condition too often, it should also give you a little performance boost ;)

I'll keep these things in mind, thanks for verifying them. I'm closing this issue.