angular-vs-repeat
angular-vs-repeat copied to clipboard
Scroll not adjusted to new height when model changes
When there is initially a large dataset, and scrollbar is at low position (e.g. item 500 of 550) and dataset reduced (i.e. to 10), scrollbar and container height don't readjust - only when "latch" is off.
this is caused by $beforeContent height not properly adjusted as startIndex is not properly adjusted.
Is there any solution for this problem ?
+1
Looks like this, #116, and #137 are all kind of related. I know I tried overcoming it with firing the resize event when I detected a model change, but didn't have any luck.
Please merge the commit from @CalMlynarczyk it really fixes the issues
👍 would love to see @CalMlynarczyk's fix merged.
Another way of fixing it is adding: if ($scope.startIndex > originalLength) { $scope.startIndex = 0; } after $scope.startIndex = $$options.latch ? _minStartIndex : __startIndex;
For me the problem occurs when I filter the repeat list with a filter after I scrolldown a bit in container, and startIndex become greater than the number of items! So the height logic get messed up unless you change the startIndex to 0 then the the items are painted and scrolling is now correct.
Any chance of this getting merged ?
I'm using @CalMlynarczyk's fork for now. It's working for me.
So...we getting this merged or what?
Using @CalMlynarczyk's fork for now as well. It fixes this issue very well.
I don't know why this hasn't been merged... Another fix is to do something like this after you change the dataset: angular.element('[vs-repeat]').scrollTop(0);
.