NervJS / taro-ui

一款基于 Taro 框架开发的多端 UI 组件库
https://taro-ui.taro.zone
MIT License
4.53k stars 758 forks source link

SwipeAction 在 h5 端使用会导致页面无法滚动 #1722

Closed yurentle closed 6 months ago

yurentle commented 9 months ago

taro-ui 版本是3.2.0 微信小程序中没有这个问题

使用方式如下:

import { View, Text } from '@tarojs/components';
import { AtSwipeAction } from 'taro-ui';
import './index.less'

export default function List() {
  const list = [
    '我是标题',
    '我是标题',
    '我是标题',
    '我是标题',
    '我是标题',
    '我是标题',
    '我是标题',
    '我是标题',
    '我是标题',
    '我是标题',
    '我是标题',
    '我是标题',
  ]

  return (
    <View className='scroll'>
      {
        list.map((item: any, index: number) => (
          <AtSwipeAction
            key={index}
            autoClose
            options={[
              {
                text: '删除',
                style: {
                  backgroundColor: '#4C4C4C'
                },
              }
            ]}
          >
            <View
              className='item'
              key={index}
            >
              <Text className='word'>{item.slice(0, 1)}</Text>
              <View className='wrapper'>
                <View className='title'>{item}</View>
              </View>
            </View>
          </AtSwipeAction>
        ))
      }
    </View>
  )
}
.scroll {
  height: 500px;
  overflow-y: auto;
}
.item {
  position: relative;
  display: flex;
  align-items: center;
  padding-left: 30px;
  .word {
    margin-right: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 94px;
    height: 94px;
    font-size: 30px;
    color: #246FEF;
    line-height: 42px;
    background: #E9EDFF;
    border-radius: 10px;
  }
  .wrapper {
    width: 600px;
    padding: 28px 0;
    box-sizing: border-box;
    border-bottom: 1px solid #F1F2F8;
    .title {
      margin-bottom: 10px;
      font-size: 28px;
      color: #00132D;
      line-height: 40px;
    }
  }
}
taro-ui-bot[bot] commented 9 months ago

欢迎提交 Issue~

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

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

Good luck and happy coding~

robinv8 commented 9 months ago

未发现问题,麻烦提供个可以复现的完整 demo Mov to

yurentle commented 9 months ago

https://github.com/yurentle/swipeActionTest

@robinv8 你好,这个是复现的 demo,麻烦看下

robinv8 commented 9 months ago

@yurentle 感谢反馈,已给 taro 提 PR