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

alpha.3 Calendar 滑动导致渲染层错误

Open admiao opened this issue 3 years ago • 7 comments

问题描述

当Calendar横向滑动或纵向滑动时

[渲染层错误] TypeError: Cannot read property '$$' of undefined at HTMLElement._attached.u._touchstartHandlerForDevtools (http://127.0.0.1:10463/pageframe/dev/WAWebview.js:2:1237778)

复现步骤

这是在taro 3中存在的 2版本 1版本均不测试

// 这里可以贴代码

期望行为

在taro 3中正常使用 报错信息

image image image

系统信息

补充信息

admiao avatar Nov 15 '20 09:11 admiao

欢迎提交 Issue~

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

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

Good luck and happy coding~

taro-ui-bot[bot] avatar Nov 15 '20 09:11 taro-ui-bot[bot]

请问解决了吗?遇到了同样的问题

LionelSun avatar Nov 17 '20 08:11 LionelSun

请问解决了吗?遇到了同样的问题

还没有 ,我关闭了滑动。

admiao avatar Nov 18 '20 03:11 admiao

这个问题是 SwiperItemkey 值导致的,将 key={item.value} 改成 key={key.toString()}即可。

// https://github.com/NervJS/taro-ui/blob/dev/src/components/calendar/body/index.tsx
<Swiper
  ...        
>
 {listGroup.map((item, key) => (
    <SwiperItem key={item.value} itemId={key.toString()}>
        <AtCalendarDateList
            ...
        />
   </SwiperItem>
 ))}
</Swiper>

b2nil avatar Nov 18 '20 08:11 b2nil

@b2nil 可以了,谢谢

LionelSun avatar Nov 18 '20 08:11 LionelSun

itemId

^3.0.0-alpha.3 还是无效,只能禁用 左右滑动

StarksJohn avatar Jan 07 '21 07:01 StarksJohn

^3.0.0-alpha.3 还是无效,只能禁用 左右滑动,有其他的解决办法吗

xy-xc avatar Nov 27 '21 07:11 xy-xc