angular-ui / ui-scroll

Unlimited bidirectional scrolling over a limited element buffer for AngularJS applications
http://angular-ui.github.io/ui-scroll/demo/
MIT License
327 stars 107 forks source link

The scrollbar-thumb height doesn't affect the number of existing elements #223

Closed markb-trustifi closed 5 years ago

markb-trustifi commented 5 years ago

The scrollbar-thumb height depends on the top/bottom padding heights that are calculated based on the topPadding.cache (bottomPadding.cache) size. They that can grow infinitely and thus scrollbar-thumb height can become very small. Is it possible to make it of the stable height depending on the number of existing items, for example 8 in this image?

image

dhilt commented 5 years ago

@markb-trustifi Basically the height of the scrollbar-thumb is supposed to be based on the content's size. Two workarounds I see in this situation:

markb-trustifi commented 5 years ago

I just added to datasource get function: setTimeout(() => $scope.scrollDatasource.maxIndex = remained_elements.length) But when it goes from full set of items (count) to the last partial set of items the scrollbar jumps, so I think the current solution is OK.