I have an Angular ng-repeat in scrollable div (chat window). On init it is glued to bottom, but when I scroll it to top it loads old messages from history. My problem is when I scroll to top, it adds new messages and staying on the top, which triggers load of a new heap of data e.t.c. What I want is to stay on the same position after new messages adds above.
The only solution I can imagine - to check height of chat before insertion and after insertion. And scroll top by the difference. Maybe there is a better solution?