Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

多个自定义tab都含有swiper,切换tab到autoplay=false的swiper再切换回autoplay=true的话,autoplay失效 #6892

Closed
Yuiffy opened this issue Jul 2, 2020 · 1 comment · Fixed by #7549
Assignees
Labels
A-components Area - H5 组件库相关 T-h5 Target - 编译到 H5 V-3 Version - 3.x
Milestone

Comments

@Yuiffy
Copy link

Yuiffy commented Jul 2, 2020

相关平台

H5

复现仓库

代码仓库

https://github.com/Yuiffy/taro-swiper-autoplay-issue/tree/master

实际体验网址

https://www.yuiffy.com/taro-swiper-autoplay-issue

浏览器版本: Chrome 83
使用框架: React

复现步骤

自定义tab使用display: block / none来显示不同内容;
每个tab都含有swiper,其中ATab的swiper是autoplay=true, 另外一个BTab内的swiper是autoplay=false。
一开始在ATab下,能够正常autoplay,切换到BTab,再切回ATab,则ATab下的swiper也不再autoplay了,刷新页面才能恢复。

期望结果

不同tab下的swiper的autoplay不会互相影响

实际结果

切到autoplay=false的tab后切回来,原本的swiper也不再autoplay了

环境信息

  Taro CLI 3.0.2 environment info:
    System:
      OS: macOS 10.14.6
      Shell: 5.0.16 - /usr/local/bin/bash
    Binaries:
      Node: 13.10.1 - ~/.nvm/versions/node/v13.10.1/bin/node
      Yarn: 1.22.0 - /usr/local/bin/yarn
      npm: 6.14.5 - ~/.nvm/versions/node/v13.10.1/bin/npm
    npmPackages:
      @tarojs/components: 3.0.2 => 3.0.2 
      @tarojs/mini-runner: 3.0.2 => 3.0.2 
      @tarojs/react: 3.0.2 => 3.0.2 
      @tarojs/webpack-runner: 3.0.2 => 3.0.2 
      babel-preset-taro: 3.0.2 => 3.0.2 
      eslint-config-taro: 3.0.2 => 3.0.2 
      react: ^16.10.0 => 16.13.1 


补充信息

Taro2、Taro3都能复现

更新:后续又发现用此种display: block/none来切换的tab里,两边的swiper都是autoplay=true也会有问题,切多了也会停止自动播放

@Chen-jj Chen-jj added A-components Area - H5 组件库相关 T-h5 Target - 编译到 H5 V-3 Version - 3.x labels Jul 30, 2020
@Chen-jj Chen-jj modified the milestones: 3.0.7, 3.0.8 Jul 30, 2020
@Chen-jj Chen-jj modified the milestones: 3.0.8, 3.0.9 Aug 18, 2020
@ZakaryCode
Copy link
Contributor

该问题在 2.x 中已经修复

@Chen-jj Chen-jj modified the milestones: 3.0.9, 3.0.10 Sep 2, 2020
@Chen-jj Chen-jj linked a pull request Sep 8, 2020 that will close this issue
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-components Area - H5 组件库相关 T-h5 Target - 编译到 H5 V-3 Version - 3.x
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants