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

Too small buffer size, too big viewport problem #171

Closed dhilt closed 7 years ago

dhilt commented 7 years ago

Some kind of race condition occures when the viewport is big enough while the "buffer-size" is small enough. Look at the demo! Scroller tries to break through the top border of the viewport. 5 times it loads data packs (of 3 items, per "buffer-size" = 3) and scroll position does not change, it stays at the very bottom, while should move up per each iteration.

rec001

dhilt commented 7 years ago

Workaround: play with "buffer-size", "padding" and the viewport height.

misterdev commented 7 years ago

I've played a lot with butter-size and padding but it didn't work for me. The only thing that solves it in my app is to give every item a fixed size in CSS. Using computed values like ng-style doesn't seem to work.

dhilt commented 7 years ago

@MisterDev The problem has been fixed in effective-height branch and it will be included in the next release. The branch' distributive is also available: https://raw.githubusercontent.com/angular-ui/ui-scroll/effective-height/dist/ui-scroll.js.

dhilt commented 7 years ago

The fix is in 1.7.0-rc.2 published version.