taro
taro copied to clipboard
同一页面下,Swiper 和 ScrollView 共存出现 bugs
问题描述
小程序当中,同一页面下,Swiper 和 ScrollView 共存时,
使用 setState 修改 ScrollView 的 scrollIntoView 属性,使滚动到某一元素,
后自行滚动到其它地方,
监听 Swiper 的 onChange,每隔5s触发一 setState 操作,那么在其触发时,ScorllView 会再次滚动到前面 setState 的 scrollIntoView 处,
复现步骤
// Swiper 的配置
{
autoplay: true,
interval: 5000,
duration: 300,
circular: true,
displayMultipleItems: 1,
}
// Swiper 的 onChange 事件, 此处执行一次 ScrollView 会滚动一次
onChange = e => {
this.setState({
currentIndex: e.detail.current,
});
}
// 结构,
// `ScrollView` 为 `taro` 组件, `MySwiper` 自定义组件,内有 `taro` 的 `Swiper` 一枚
<ScrollView>
<MySwiper />
</ScrollView>
期望行为 bug 修复
报错信息 无
系统信息
- 操作系统: win7
- Taro 版本 v0.0.68
- Node.js 版本 v8.11.2
好的。稍后跟进一下