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

useInfiniteScroll getClientHeight error #1515

Closed
brickspert opened this issue Mar 22, 2022 · 4 comments · Fixed by #2119
Closed

useInfiniteScroll getClientHeight error #1515

brickspert opened this issue Mar 22, 2022 · 4 comments · Fixed by #2119
Assignees
Labels
bug Something isn't working

Comments

@brickspert
Copy link
Collaborator

想问一下,useInfiniteScroll所使用的getClientHeight这个方法是不是有点问题?这边想获取视窗的高度,应该是使用el.clientHeight || document.documentElement.clientHeight || document.body.clientHeight吧?
经测试,在chrome上document.body.clientHeight会返回body的高度,导致当useInfiniteScroll传入的target为document时,会在未滚动触底的情况下自动触发handler

@brickspert brickspert added the bug Something isn't working label Mar 22, 2022
@brickspert brickspert self-assigned this Mar 22, 2022
@taoliujun
Copy link

如何修复这个问题呢?

@brickspert
Copy link
Collaborator Author

如何修复这个问题呢?

参考下这里:#1516 (comment)

@taoliujun
Copy link

如果限定了body的高度,那么失去了以document为滚动父元素的意义,我使用了该方式:#1563

@hchlq
Copy link
Collaborator

hchlq commented Mar 15, 2023

统一在 #2119 中处理

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants