raxjs / rax-components

Rax base components
https://github.com/alibaba/rax
Other
90 stars 74 forks source link

RecyclerView 带上 itemSize 会导致 touch 事件无法触发 #451

Closed answershuto closed 2 years ago

answershuto commented 2 years ago

应该是虚拟列表逻辑有问题。

<View className={styles.homeContainer}>
        <RecyclerView
          itemSize={100}
          style={{
            height: 800,
          }}
          onTouchStart={() => {
            console.log('onTouchStart')
          }}
        >
          <RecyclerView.Cell key={1}>
            <View>123</View>
          </RecyclerView.Cell>
          <RecyclerView.Cell key={2}>
            <View>123</View>
          </RecyclerView.Cell>
          <RecyclerView.Cell  key={3}>
            <View>123</View>
          </RecyclerView.Cell>
        </RecyclerView>
    </View>