taro-ui icon indicating copy to clipboard operation
taro-ui copied to clipboard

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

Open Zhao187 opened this issue 1 year ago • 6 comments

问题描述 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 版本 v3.6.27
  • Taro UI 版本 v3.3.0
  • 报错平台 h5, weapp

补充信息

Zhao187 avatar Apr 28 '24 08:04 Zhao187

欢迎提交 Issue~

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

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

Good luck and happy coding~

taro-ui-bot[bot] avatar Apr 28 '24 08:04 taro-ui-bot[bot]

我也遇到这个问题了

SiNanQrn avatar Jun 16 '24 02:06 SiNanQrn

我也遇到这个问题了

SiNanQrn avatar Jun 16 '24 02:06 SiNanQrn

我也遇到了这个问题

Cathy-Majie avatar Jun 24 '24 06:06 Cathy-Majie

我也遇到了

superchenwb avatar Aug 23 '24 14:08 superchenwb

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

xieyanxx avatar Aug 27 '24 08:08 xieyanxx