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

[Feature] rax-scrollview 表现对齐 & 修改属性名 #386

Open
cryzzchen opened this issue Aug 2, 2021 · 3 comments
Open

[Feature] rax-scrollview 表现对齐 & 修改属性名 #386

cryzzchen opened this issue Aug 2, 2021 · 3 comments
Assignees

Comments

@cryzzchen
Copy link
Contributor

cryzzchen commented Aug 2, 2021

1)属性名: onEndReachedThreshold 修改为 endReachedThreshold,表示加载更多的偏移值
2)表现对齐:

  • onEndReached
    在 Web 下,仅当 contentSize 发生变化时,滑动到底部才能触发 onEndReached 回调; 在小程序中,滑动到底部就能触发 onEndReached 回调;
  • resetScroll
    在 Web、weex 和非微信小程序中,调用 resetScroll 时,不改变组件展示;在微信小程序中,会滚动到顶部;

在对齐各端表现的前提下,onEndReached 在业务中一般用来做加载更多内容的功能,如果只判断滑到底部就触发onEndReached回调可能会造成短时间内多次获取更多内容的情况,因此删除 resetScroll,增加 resetEndReached,用于重置触底事件,若业务需要滚动到顶部,可调用scrollTo

  • onEndReached
    当且仅当列表第一次或调用 resetEndReached 的第一次滚动到底部时,才触发onEndReached.
  • resetEndReached
    用于重置 endReached 状态。
function App() {
  function handleEndReached() {
     loadMorePromise().then(() => {
        // ....
       scrollView.resetEndReached();
    })
  }
  return (
    <ScrollView
       ref={scrollView}
      onEndReached={handleEndReached}
    >
    //...
   </ScrollView>
  );
}

相关issue:
#243
#383

weex 中 resetLoadmore 的讨论:alibaba/weex#1664 (comment)

@cryzzchen
Copy link
Contributor Author

cryzzchen commented Aug 2, 2021

@cryzzchen cryzzchen self-assigned this Aug 2, 2021
@ChrisCindy
Copy link
Contributor

这是打算 break change?另微信和支付宝小程序的表现建议都验证一下,保证体验一致

@cryzzchen
Copy link
Contributor Author

这是打算 break change?另微信和支付宝小程序的表现建议都验证一下,保证体验一致

是啊

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