Skip to content
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

model.canLoadMore not updating #396

Open
Redsandro opened this issue Oct 29, 2019 · 6 comments
Open

model.canLoadMore not updating #396

Redsandro opened this issue Oct 29, 2019 · 6 comments

Comments

@Redsandro
Copy link
Contributor

When a filter on the model (e.g. a live updating search function) causes the number of documents in a model to increase, and the total number of documents is so small that the infinityModel is entirely visible so that the infinity-loader component is visible, the model.canLoadMore does not get set to false when there are no more records to load.

E.g.:

{{#infinity-loader infinityModel=model hideOnInfinity=false}}
  {{#if model.canLoadMore}}
    <p>
      Loading
    </p>
  {{/if}}
{{/infinity-loader}}

If changing a filter so that in order you'll see:

  • 100 results -> fine
  • 10 results -> fine
  • 1 result -> fine
  • 2 results -> not fine. Permanently shows "Loading"
@jagthedrummer
Copy link

I've been having this same problem, but the workaround suggested here is working for me as a short-term solution: #327 (comment)

@snewcomer
Copy link
Collaborator

Looks like this is something we need to fix! Will try and look before the end of the year.

@Redsandro
Copy link
Contributor Author

@snewcomer I'm curious if you had a chance to look at this. Have you figured out how to fix the canLoadMore?

@snewcomer
Copy link
Collaborator

Actually upon second look, reachedInfinity is the property we suggest you use. On every request, we set(infinityModel, 'reachedInfinity', !canLoadMore);. canLoadMore is simply a API item to tell the infinityModel to always keep requesting no matter what.

Let me know what you think!

@Redsandro
Copy link
Contributor Author

@snewcomer it works indeed when used around infinity-loader, not inside of it. This was my mistake.

Ultimately this is an extension of trying to work around #395, and I see you've created a PR for that, so we can simply use the helper! Although I have not tested it yet.

@snewcomer
Copy link
Collaborator

I see! Well give 2.0.3 a try and lmk how it goes!

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

3 participants