angular-vs-repeat icon indicating copy to clipboard operation
angular-vs-repeat copied to clipboard

Scroll not adjusted to new height when model changes

Open grnadav opened this issue 8 years ago • 11 comments

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.

grnadav avatar May 02 '16 07:05 grnadav

Is there any solution for this problem ?

guptag avatar Aug 24 '16 00:08 guptag

+1

v4l3r10 avatar Sep 04 '16 15:09 v4l3r10

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.

CalMlynarczyk avatar Sep 22 '16 01:09 CalMlynarczyk

Please merge the commit from @CalMlynarczyk it really fixes the issues

alevinru avatar Nov 30 '16 22:11 alevinru

👍 would love to see @CalMlynarczyk's fix merged.

jivinivan avatar Dec 06 '16 13:12 jivinivan

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.

coolblades avatar Apr 05 '17 13:04 coolblades

Any chance of this getting merged ?

samk-ayyagari avatar Apr 13 '17 06:04 samk-ayyagari

I'm using @CalMlynarczyk's fork for now. It's working for me.

CyborgMaster avatar May 03 '17 21:05 CyborgMaster

So...we getting this merged or what?

rand0mC0d3r avatar Jul 14 '17 15:07 rand0mC0d3r

Using @CalMlynarczyk's fork for now as well. It fixes this issue very well.

kylebake avatar Sep 29 '17 19:09 kylebake

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);.

c24w avatar Feb 16 '18 10:02 c24w