Reputation: 1571
I've got a ul > li list of items, with a reload button on top. If I hit the reload button, items are added async to the data model. Every time an item is added to the model, it is shown in the view, and the browser scrolls to the top. It's an Cordova app (HTML5). I can of course remember scroll position and scroll back, but that might become visible and is just a hack imo.
How can I make sure the scroll position stays at the same place?
Upvotes: 0
Views: 934
Reputation: 1525
I think the problem is:
I suggest the solution, try to use $track by $index
in angular ng-repeat https://docs.angularjs.org/api/ng/directive/ngRepeat
Upvotes: 1