jd-opensource / jd-opensource/nutui

nut-list listData 为空时,有报错'dValue' of undefinedat updateCachedPosition;bottom' of undefined at getStartIndex

Open
#3,182 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vue
Stars
6.5k
Forks
835
PR merge metrics
No merged PRs in 30d

Description

### NutUI 包名

@nutui/nutui-taro

### NutUI 版本号

3.3.8

### 平台

weapp

### 重现链接

https://nutui.jd.com/playground/#eyJBcHAudnVlIjoiPHNjcmlwdCBzZXR1cCBsYW5nPVwidHNcIj5cbmltcG9ydCB7IHJlZiwgZGVmaW5lQ29tcG9uZW50IH0gZnJvbSAndnVlJ1xuXG5sZXQgbGlzdERhdGEgPSByZWYobmV3IEFycmF5KDEwMCkuZmlsbCgwKSlcblxuY29uc3QgY2xlYXIgPSAoKT0+e1xuICBsaXN0RGF0YS52YWx1ZT1bXVxufVxuPC9zY3JpcHQ+XG48dGVtcGxhdGU+XG4gIDx2aWV3ID5cbiAgICA8bnV0LWJ1dHRvbiBAY2xpY2s9XCJjbGVhclwiPmNsZWFyPC9udXQtYnV0dG9uPlxuICAgIDxudXQtbGlzdCA6aGVpZ2h0PVwiNTBcIlxuICAgICAgICAgICAgICA6bGlzdERhdGE9XCJsaXN0RGF0YVwiXG4gICAgICAgICAgICAgIDpjb250YWluZXItaGVpZ2h0PVwiMzAwXCIgPlxuICAgICAgPHRlbXBsYXRlIHYtc2xvdD1cInsgaXRlbSwgaW5kZXggfVwiPlxuICAgICAgICA8ZGl2IGNsYXNzPVwibGlzdC1pdGVtXCI+XG4gICAgICAgICAge3sgaW5kZXggfX1cbiAgICAgICAgPC9kaXY+XG4gICAgICA8L3RlbXBsYXRlPlxuICBcdDwvbnV0LWxpc3Q+XG4gIDwvdmlldz5cbjwvdGVtcGxhdGU+In0=

### 重现步骤

向下滚动一定的距离。点击clear即可,有报错

### 期望的结果是什么?

scrollHeight=0
scrollTop=0.
无报错

### 实际的结果是什么?

1、数据清空时有报错TypeError: Cannot read property 'dValue' of undefined at updateCachedPosition
2、scrollHeight仍有高度。可以滚动,滚动时有报错TypeError: Cannot read properties of undefined (reading 'bottom')

### 环境信息

Taro v3.6.34

Taro CLI 3.6.34 environment info:
System:
OS: Windows 10 10.0.19045
Binaries:
Node: 18.19.0 - H:\SoftFiles\nodejs\node.EXE
npm: 10.2.3 - H:\SoftFiles\nodejs\npm.CMD
npmPackages:
@tarojs/cli: 3.6.34 => 3.6.34
@tarojs/components: 3.6.34 => 3.6.34
@tarojs/helper: 3.6.34 => 3.6.34
@tarojs/plugin-framework-vue3: 3.6.34 => 3.6.34
@tarojs/plugin-html: ^3.6.33 => 3.6.33
@tarojs/plugin-platform-alipay: 3.6.34 => 3.6.34
@tarojs/plugin-platform-h5: 3.6.34 => 3.6.34
@tarojs/plugin-platform-jd: 3.6.34 => 3.6.34
@tarojs/plugin-platform-qq: 3.6.34 => 3.6.34
@tarojs/plugin-platform-swan: 3.6.34 => 3.6.34
@tarojs/plugin-platform-tt: 3.6.34 => 3.6.34
@tarojs/plugin-platform-weapp: 3.6.34 => 3.6.34
@tarojs/runtime: 3.6.34 => 3.6.34
@tarojs/shared: 3.6.34 => 3.6.34
@tarojs/taro: 3.6.34 => 3.6.34
@tarojs/taro-loader: 3.6.34 => 3.6.34
@tarojs/webpack5-runner: 3.6.34 => 3.6.34
babel-preset-taro: 3.6.34 => 3.6.34
eslint-config-taro: 3.6.34 => 3.6.34

### 其他补充信息

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.