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

docs(useInfiniteScroll): add usage note #1701

Closed
wants to merge 1 commit into from

Conversation

luveqz
Copy link

@luveqz luveqz commented Jun 17, 2022

Description

It took me some time to realize that I needed to care about the content's height, as this is not how popular libraries like vue-infinite-loading work.

Also, I'm not the first person to have this issue. See #1685 (comment).

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@antfu
Copy link
Member

antfu commented Jul 6, 2022

/cc @webfansplz is it possible to avoid this limitation?

@webfansplz
Copy link
Member

Can we just provide a forceFire option to support it ?

Force triggered the onLoadMore callback once when the container element's height >= content's height.

@antfu
Copy link
Member

antfu commented Jul 6, 2022

Just wondering if other libs could support it, any blockers for us to support it automatically?

@webfansplz
Copy link
Member

Just wondering if other libs could support it, any blockers for us to support it automatically?

I didn't find a good way to support it automatically because that for the browser native behavior ,the scroll event’ll never triggered when the container element's height >= content's height 😅

The vue-infinite-loading library seems triggered callback once when init, See:

https://github.com/PeachScript/vue-infinite-loading/blob/4baed2bb078f076d3bff48c783ed324236630ed6/src/components/InfiniteLoading.vue#L160

@stale
Copy link

stale bot commented Sep 14, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

Successfully merging this pull request may close these issues.

None yet

3 participants