jd-opensource / jd-opensource/taro-ui

SwipeAction在安卓机上有的时候滑动不了

Open
#1,063 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.7k
Forks
740
PR merge metrics
No merged PRs in 30d

Description

**问题描述**
SwipeAction组件和一个列表一起使用。从右向左滑动,偶尔有些ListItem滑动不了。同样的一个小程序,在iphone里没有这个问题,只在安卓手机上发现。
**复现步骤**

```js
import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
import { AtSwipeAction } from 'taro-ui'
import './Swipe.scss'

/**
* swipe sample
*/
class Swipe extends Component {
state = {
openedIndex: null,
}

/**
* @param {number} index
*/
handleOnopen(index) {
this.setState({
openedIndex: index,
})
}

/**
* @return {object}
*/
render() {
const options = [
{
text: '取消',
style: {
backgroundColor: '#6190E8',
},
},
{
text: '确认',
style: {
backgroundColor: '#FF4949',
},
},
]
const list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
const { openedIndex } = this.state
const content = list.map((item, index) => (

{`Item ${index + 1}`}

))
return ({content})
}
}

export default Swipe

```

**期望行为**
滑动一个ListItem,这个ListItem会按照手势滑动

**报错信息**

**系统信息**

**补充信息**
我debug了下,发现在出现不能移动的情况下,能看到onTouchStart的回调,onTouchMove回调也会有,但是特别少。
还发现了一个现象,如果只显示单个item打开,就有这个问题。如果所有的item都允许同时打开,那么也就不会存在这个问题。

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.