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

Handle failures when setting scrollTop after prepend so view does not jump #206

Closed conraddamon closed 6 years ago

conraddamon commented 6 years ago

When handling a scroll event, see if we recently set scrollTop and check whether it worked (by seeing if the current is closer to what we set it to, or the value before that). If it failed, set a flag so we don't try to keep prepending items.

The failure appears to happen primarily on Mac Chrome, and also on Safari.