I have an ng-repeat that loads posts from a firebase database. I load the items in reverse so as new posts are made, they appear at the top of the list (similar to Facebook). I have been able to maintain scroll position for the user if a new item is added to the top, however, when a post is deleted, I cannot seem to keep the post the user was looking at in view. The div will shift the content to fill the voided space. Is there an elegant solution to this problem? I am able to accomplish this if each post was the same height, however, different posts are different heights.
I maintain scroll when adding a post through most likely a sloppy method. In the ng-repeat, I add a class "first". Using arrivejs, when a new ".first" element is loaded, I calculate the posts height and the scrollTop of the container and just do some math.
Any suggestions are greatly appreciated.