Skip to content

4.0.5 swiper组件无法手动滑动 #16517

@ShaoGongBra

Description

@ShaoGongBra

相关平台

H5

浏览器版本: 所有
使用框架: React

复现步骤

只要将Swiper嵌套在ScrollView里面,就无法手动滑动Swiper

<ScrollView style={{ height: px(1000) }}>
    <Swiper autoplay circular interval={2800} style={{ height: px(500) }}>
      {
        [
          {
            "image": "https://cdn.whxx.net/2024-07-23/90a0b94e58c153532ffd.png",
            "title": "实景鉴赏",
            "desc": "",
            "url": ""
          },
          {
            "image": "https://cdn.whxx.net/2024-07-23/681f655f025128863b56.png",
            "title": "实景鉴赏",
            "desc": "",
            "url": "duxcmsContent/pages/article/detail?id=17"
          },
          {
            "image": "https://cdn.whxx.net/2024-07-23/18ffc7f104d5a2f433fc.jpg",
            "title": "实景鉴赏",
            "desc": "",
            "url": "https://mp.weixin.qq.com/s/e5NgkUntaOvR0mQ5WWyfDA"
          },
          {
            "image": "https://cdn.whxx.net/2024-08-31/95a5ffc76b997415b992.png",
            "url": "playerUnion/pages/match/detail?id=17"
          }
        ].map(item => {
          return <SwiperItem key={item.id}>
            <Image src={item.image} className='w-full h-full'
              onClick={() => {
                if (item.url?.startsWith('http')) {
                  window.location.href = item.url
                } else {
                  nav(item.url)
                }
              }}
            />
          </SwiperItem>
        })
      }
    </Swiper>
  </ScrollView>

期望结果

1

实际结果

2

环境信息

Taro CLI 4.0.5 environment info:
    System:
      OS: macOS 14.5
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 22.8.0 - /var/folders/rf/gd60z12164z72bny7z_0d4f80000gn/T/yarn--1726195625894-0.2265751482366889/node
      Yarn: 1.22.22 - /var/folders/rf/gd60z12164z72bny7z_0d4f80000gn/T/yarn--1726195625894-0.2265751482366889/yarn
      npm: 10.8.2 - ~/.nvm/versions/node/v22.8.0/bin/npm
    npmPackages:
      @tarojs/cli: 4.0.5 => 4.0.5 
      @tarojs/components: 4.0.5 => 4.0.5 
      @tarojs/helper: 4.0.5 => 4.0.5 
      @tarojs/plugin-framework-react: 4.0.5 => 4.0.5 
      @tarojs/plugin-platform-alipay: 4.0.5 => 4.0.5 
      @tarojs/plugin-platform-h5: 4.0.5 => 4.0.5 
      @tarojs/plugin-platform-jd: 4.0.5 => 4.0.5 
      @tarojs/plugin-platform-qq: 4.0.5 => 4.0.5 
      @tarojs/plugin-platform-swan: 4.0.5 => 4.0.5 
      @tarojs/plugin-platform-tt: 4.0.5 => 4.0.5 
      @tarojs/plugin-platform-weapp: 4.0.5 => 4.0.5 
      @tarojs/react: 4.0.5 => 4.0.5 
      @tarojs/rn-runner: 4.0.5 => 4.0.5 
      @tarojs/rn-supporter: 4.0.5 => 4.0.5 
      @tarojs/runtime: 4.0.5 => 4.0.5 
      @tarojs/shared: 4.0.5 => 4.0.5 
      @tarojs/taro: 4.0.5 => 4.0.5 
      @tarojs/taro-loader: 4.0.5 => 4.0.5 
      @tarojs/taro-rn: 4.0.5 => 4.0.5 
      @tarojs/webpack5-runner: 4.0.5 => 4.0.5 
      babel-preset-taro: 4.0.5 => 4.0.5 
      eslint-config-taro: 4.0.5 => 4.0.5 
      expo: ~51.0.32 => 51.0.32 
      react: ^18.2.0 => 18.3.1 
      react-native: ~0.75.3 => 0.75.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    F-reactFramework - ReactT-h5Target - 编译到 H5V-4Version - 4.x

    Type

    No type

    Projects

    Status

    Padding

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions