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

Hard reload of the rawgit/github.io/local demos breaks the view #189

Closed dhilt closed 6 years ago

dhilt commented 6 years ago

After hard reload, the ui-scroll fetching mechanism breaks down: shouldLoadTop/shouldLoadBottom methods return false due to viewport.bottomVisiblePos() returns invalid value.

Per AngularJS Automatic Initialization doc:

AngularJS initializes automatically upon DOMContentLoaded event or when the angular.js script is evaluated if at that time document.readyState is set to 'complete'.

So if I have some class-style on the viewport (which provides necessary height to the viewport and which is comming from external resource), then the initialization of the app and initialization of the ui-scroll may occure before that external resource is downloaded and applied.

Possible workarounds:

dhilt commented 6 years ago

Closed due to v1.7.0-rc.5 containing the fix has been released.