jd-opensource / jd-opensource/taro-ui

AtSwipeAction 加载时候报错TypeError: Cannot read properties of null (reading 'width')

Open
#1,786 6 comments 3 reactions 1 assignee Claimed by @robinv8 View on GitHub
Dominant language
TypeScript
Stars
4.7k
Forks
740
PR merge metrics
No merged PRs in 30d

Description

**问题描述**
taro3使用taro ui中的AtSwipeAction做滑动删除,界面加载中报错TypeError: Cannot read properties of null (reading 'width')

**复现步骤**
```js
1.import {AtButton, AtList, AtListItem, AtNavBar,AtSwipeAction} from 'taro-ui'

{
this.state.list.map((item, index) => {
return (
{

}} options={[
{
text: '删除',
style: {
backgroundColor: '#FF4949'
}
}
]}>


)
})
}

```

**期望行为**
控制台不报错,可以正常使用

**报错信息**
index.esm.js:6128 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'width')
at AtSwipeAction.eval (index.esm.js:6128:50)
at step (index.esm.js:218:17)
at Object.eval [as next] (index.esm.js:167:14)
at fulfilled (index.esm.js:126:24)

**系统信息**
- Taro 版本 v3.6.27
- Taro UI 版本 v3.3.0
- 报错平台 h5, weapp

**补充信息**

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.