raxjs / rax-components

Rax base components
https://github.com/alibaba/rax
Other
90 stars 73 forks source link

rax-scrollview resetScroll导致向上滚动也会触发onEndReached #383

Open clumiere opened 3 years ago

clumiere commented 3 years ago

如果onEndReached异步请求失败,需要重置状态,使得可以再次向下滚动触发onEndReached,resetScroll中直接lastScrollDistance重置为0,导致第一次往上滚动也会触发onEndReached了

clumiere commented 3 years ago

lastScrollDistance不需要重置为0

fyangstudio commented 3 years ago

onEndReached 个人直觉也是不应该加锁,滑动到底就触发。

scrollview 作为基础组件,绝大部分活动页面都有用到它。可能是兼容了某些场景和历史问题导致现在的设计,也维持了一段时间,需要统计下影响面,再做决策。

针对上文场景,建议再最下层 插入一个 1px 的 view,监听这个 view 的 appear 事件,去判断触底