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

Fix: infinite call loadMore when height changes but not enough #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tianjianchn
Copy link

@tianjianchn tianjianchn commented Oct 10, 2017

修复以下情况下会导致无限调用 loadMore 的情况:

  1. 当调用 loadMore,产生新的高度变化,但是这个高度不够 infinite-scroll-distance 时,导致再次调用 loadMore
  2. 当调用 loadMore 时,由于底部有加载动作条渲染,而实际上又没有新的数据(比如接口返回零行),导致无限调用 loadMore

相关 Issue 参考: #35 #18

会产生以下副作用

  1. 当滚动条下方不足 distance 大小时,只会触发一次 loadMore,而不是滚动一下就调用一次
  2. 如果在某一时刻,整个 element 的滚动条可滚动区域都不足 infinite-scroll-distance,将不会再产生新的事件了(即不会再调用 loadMore 了)。其实这跟没有滚动条的情况是一样的,都需要用户自己去处理(比如在底部加一个"点击加载更多”状态条)

修复以下情况下会导致无限调用 loadMore 的情况:
1. 当调用 loadMore,产生新的高度变化,但是这个高度不够 infinite-scroll-distance 时,导致再次调用 loadMore
2. 当调用 loadMore 时,由于底部有加载动作条渲染,而实际上又没有新的数据(比如接口返回零行),导致无限调用 loadMore

ElemeFE#35
ElemeFE#18
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.

1 participant