Skip to content

adapter reload() top issue #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MartyBolton opened this issue Mar 25, 2016 · 2 comments
Closed

adapter reload() top issue #73

MartyBolton opened this issue Mar 25, 2016 · 2 comments

Comments

@MartyBolton
Copy link

Hi guys, I've been experiencing some random adapter reload issues and at first I thought it was just something I'm not doing right. Wondering if you can take a look at this repro. If you scroll down the list a few ways after append is called (buffer = 15), and click on reload, it sometimes does not return the list to the top. I also notice in this repro the first couple times, view port also does not fill up.
https://jsfiddle.net/MartyBolton/wf7o0ded/3/

Here's essentially all I'm doing in my app and repro. Wondering if I'm doing something wrong here. I didn't see any reload examples in demo.
thanks
Marty

html
  <li ui-scroll="item in datasource" buffer-size="15" ng-class="{'odd': item.id % 2}" style="height:{{useIrregularHeight ? item.size + 22 : 150}}px;" adapter="feedAdapter.adapter">

 // adapter implementation
    $scope.feedAdapter = { adapter: { remain: true } };
    $scope.reload = function() {
      console.log ('reloading');
     $scope.feedAdapter.adapter.reload();
    }
@dhilt
Copy link
Member

dhilt commented Mar 25, 2016

This situation is like a previous one which was posted by you in issue #65. And the code in paddings branch fixes this issue too. So I forked your demo -- https://jsfiddle.net/dhilt/oq19h1ts/ -- and did nothing but changed ui.scroll directive source code with a code from here.

This code is not in 'master' cause we are trying to understand if there is a simplier way to solve Average items height problem that I found and implemented in 'paddings' branch.

@MartyBolton
Copy link
Author

Thanks @dhilt. I took your paddings code and testing it in live project and finding that it does address this issue too! Thanks a ton. Sorry, I didn't test that earlier myself. I thought about it this morning to late. We can close this since paddings is more relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants