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

nut-list在非无限制滚动的情况下,滚动到底部会报错,且配置了固定高度height和margin属性不生效 #2286

Closed
aibayanyu20 opened this issue May 9, 2023 · 3 comments · Fixed by #2658
Labels
h5 Taro H5 环境下的问题 reproducible 提供了可复现代码,或者已验证可复现
Milestone

Comments

@aibayanyu20
Copy link

NutUI scenes(nutui 场景)

H5(@nutui/nutui)

NutUI-vue version(nutui-vue 版本)

4.0.6

Vue version(vue 版本)

3.2.47

Operating environment(运行环境)

dev:h5

Citation method(引用方式)

npm

Node version(node 版本)

16.19.1

Browser and its version(浏览器及其版本)

113

System and its version(系统及其版本)

win11

Reproduction link(重现链接)

codesandbox.io

Steps to reproduce(重现步骤)

滚动到底部可以看到报错信息:TypeError: Cannot read properties of undefined (reading 'height')
分析原因是100条数据是0-99然而组件中出现了cachePositions[100]导致的原因。
在外部配置了height不能生效,只是内部使用了这个属性,margin也是一样的

What is expected?(期望的结果是什么?)

期望不报错且height和margin配置可以生效

What is actually happening?(实际的结果是什么?)

实际报错且不生效

@hisunny520
Copy link

hisunny520 commented May 11, 2023

同样有问题

TypeError: Cannot read property 'bottom' of undefined
    at getStartIndex (index.js?t=wechat&s=1683783755457&v=020e2802d963405c2d2098285637be12:2)
    at _callee2$ (index.js?t=wechat&s=1683783755457&v=020e2802d963405c2d2098285637be12:2)
    at tryCatch (vendors.js?t=wechat&s=1683783755457&v=fefd19a8b82c2d9bdb5571c6dc935ebf:2)
    at Generator.<anonymous> (vendors.js?t=wechat&s=1683783755457&v=fefd19a8b82c2d9bdb5571c6dc935ebf:2)
    at Generator.next (vendors.js?t=wechat&s=1683783755457&v=fefd19a8b82c2d9bdb5571c6dc935ebf:2)
    at asyncGeneratorStep (vendors.js?t=wechat&s=1683783755457&v=fefd19a8b82c2d9bdb5571c6dc935ebf:2)
    at _next (vendors.js?t=wechat&s=1683783755457&v=fefd19a8b82c2d9bdb5571c6dc935ebf:2)
    at vendors.js?t=wechat&s=1683783755457&v=fefd19a8b82c2d9bdb5571c6dc935ebf:2
    at new Promise (<anonymous>)
    at Proxy.<anonymous> (vendors.js?t=wechat&s=1683783755457&v=fefd19a8b82c2d9bdb5571c6dc935ebf:2)(env: Windows,mp,1.06.2208010; lib: 2.25.4)

@eiinu eiinu added this to the v4.1.0 milestone May 11, 2023
@eiinu eiinu added the h5 Taro H5 环境下的问题 label May 11, 2023
@eiinu eiinu added the reproducible 提供了可复现代码,或者已验证可复现 label May 26, 2023
@zhangyuanliang
Copy link
Contributor

这个bug没有修复计划?或者通过什么方式可以避免?

@eiinu
Copy link
Member

eiinu commented Nov 13, 2023

这个bug没有修复计划?或者通过什么方式可以避免?

建议使用 InfiniteLoading(h5) 或者 ScrollView(taro) 组件替代。List 虚拟组件问题较多,效果不佳,后面可能会废弃。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
h5 Taro H5 环境下的问题 reproducible 提供了可复现代码,或者已验证可复现
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants