NervJS / taro-ui

一款基于 Taro 框架开发的多端 UI 组件库
https://taro-ui.taro.zone
MIT License
4.53k stars 758 forks source link

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

Open Zhao187 opened 5 months ago

Zhao187 commented 5 months ago

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

复现步骤

1.import {AtButton, AtList, AtListItem, AtNavBar,AtSwipeAction} from 'taro-ui'

<AtList hasBorder={true}>
          {
            this.state.list.map((item, index) => {
              return (
                <AtSwipeAction key={index} onClick={(data, index, event)=>{

                }} options={[
                  {
                    text: '删除',
                    style: {
                      backgroundColor: '#FF4949'
                    }
                  }
                ]}>
                  <AtListItem
                    key={index}
                    title={item.friendNickname}
                    thumb={item.friendFaceImage}
                    note={item.msg}
                    extraText={item.isRead ? '' : '未读'}
                  />
                </AtSwipeAction>
                )
            })
          }
        </AtList>

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

报错信息 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-ui-bot[bot] commented 5 months ago

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

SiNanQrn commented 3 months ago

我也遇到这个问题了

SiNanQrn commented 3 months ago

我也遇到这个问题了

Cathy-Majie commented 3 months ago

我也遇到了这个问题

superchenwb commented 1 month ago

我也遇到了

xieyanxx commented 1 month ago

我也遇到了这个问题请问是怎么解决的呢