angular-fullpage.js icon indicating copy to clipboard operation
angular-fullpage.js copied to clipboard

Don't scroll to top slide when adding items inside ng-repeat

Open haplo31 opened this issue 9 years ago • 2 comments

Hello, I have a page with 3 sections and the last of them contains a list of items. I need to add some new items to this list but when I do, fullpage scrolls to the top slide of the page. I can't find a way to avoid this behavior and I started to think it may be not doable...

I did a plunker to show the problem: https://plnkr.co/edit/sVOIuGzhawS1yMn6P6tr?p=preview

Is there a solution to prevent the scroll to happen or, at least, to scroll back to the previous slide after the reload?

Thanks for your time!

haplo31 avatar Jun 25 '16 16:06 haplo31

if you are adding in the sections dynamically with angular, or changing the options, then unfortunately I don't think there isn't a way currently to avoid the behavior. I will see if $.fullpage.reBuild() got any changes or updates, but currently,when you add/remove items, the plugin has to destroy and add itself again.

hellsan631 avatar Jun 25 '16 19:06 hellsan631

Thanks for your answer. I managed to bypass the problem by changing the rebuilt function in your directive. I use your original code for the first call and $.fullpage.reBuild() after that and it seems to work, no more reload of the page when I add something in my ng-repeat.

However, my work is still not done because I seem to be unable to scroll to the bottom of the page after that, with or without my modification in your directive FullpageJs doesn't seem to have a function for that and the usuals methods doesn't work... Do you know a way to scroll to the bottom of a page where fullpage is active?

Thanks again for your time!

haplo31 avatar Jun 29 '16 14:06 haplo31