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

uList控件滑动bug #149

Open
Jerry930326 opened this issue Dec 9, 2021 · 2 comments
Open

uList控件滑动bug #149

Jerry930326 opened this issue Dec 9, 2021 · 2 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@Jerry930326
Copy link

Jerry930326 commented Dec 9, 2021

版本

2.0.10

转载链接

www.uviewui.com

重现步骤

2个bug,步骤:
1、布局使用 <u-list><u-list-item v-for></u-list-item></u-list> 嵌套
2、初始化10条数据。
3、滑动到底部使用 @scrolltolower 事件加载更多回调新增10条数据。
4、【Bug 1】加载更多后继续向下滑动,在第11条数据上滑时,会发生数据错位,第11条数据滑动到顶部再向上偏移一点时会瞬间变成第10条数据。
5、【Bug 2】页面滑动到顶部,会继续收到 @scrolltolower 事件加载更多回调。

期望的结果是什么?

1、数据不发生错乱。
2、滑动到顶部不会收到 @scrolltolower 事件。

实际的结果是什么?

1、数据错乱。
2、滑动到顶部也会收到 @scrolltolower 事件。


请看2.0.10中u-list源码的 scrolltoupper()方法中你们写的代码,也发送scrolltolower事件,注释还写虎狼之词。。。。

// #ifndef APP-NVUE
// 滚动到底部时触发,非nvue有效
scrolltoupper(e) {
uni.$u.sleep(30).then(() => {
this.$emit('scrolltolower')
// 这一句很重要,能绝对保证在性功能障碍的webview,滚动条到顶时,取消偏移值,让页面置顶
this.offset = 0
})
}
// #endif

@Jerry930326
Copy link
Author

Jerry930326 commented Dec 10, 2021

数据错乱的问题使用 <u-list><view v-for></view></u-list> 这种嵌套就没问题了,应该是 <u-list-item>有问题。

@yatoku
Copy link
Collaborator

yatoku commented Jan 17, 2022

滚动异常的原因是因为在u-list组件中,设置了一个padding-top的属性导致的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants