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

taro3 react H5 快速来回切换tabBar,无法保证定位当前页面 #10426

Closed
lsj162 opened this issue Oct 15, 2021 · 6 comments · Fixed by #10658
Closed

taro3 react H5 快速来回切换tabBar,无法保证定位当前页面 #10426

lsj162 opened this issue Oct 15, 2021 · 6 comments · Fixed by #10658
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x
Projects
Milestone

Comments

@lsj162
Copy link

lsj162 commented Oct 15, 2021

相关平台

H5

浏览器版本: chrome 94
使用框架: React

复现步骤

来回切换tabbar

期望结果

可以定位到当前的tabbar页面

实际结果

不稳定

环境信息

👽 Taro v3.3.9


  Taro CLI 3.3.9 environment info:
    System:
      OS: macOS 11.5.2
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 14.17.1 - /usr/local/bin/node
      Yarn: 1.22.10 - /usr/local/bin/yarn
      npm: 8.0.0 - /usr/local/bin/npm
    npmPackages:
      @tarojs/react: 3.3.9 => 3.3.9
      @tarojs/runtime: 3.3.9 => 3.3.9
      @tarojs/taro: 3.3.9 => 3.3.9
      react: ^17.0.0 => 17.0.2
    npmGlobalPackages:
      typescript: 4.3.5

@taro-bot2 taro-bot2 bot added F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x labels Oct 15, 2021
@LuXinZ
Copy link
Contributor

LuXinZ commented Oct 15, 2021

快速切换应该是 切换路由的有定时器造成的, 你在切换路由包裹一层定时器, 时间5毫秒试试

@shushu2013
Copy link
Contributor

shushu2013 commented Oct 20, 2021

遇到了相同的问题

相关平台

H5

Safari 和 Chrome 浏览器上都能复现此问题

复现仓库

https://github.com/shushu2013/taro-h5-bugs-example

浏览器版本:

Safari浏览器 版本14.1.2 (16611.3.10.1.6)
Chrome浏览器 版本 94.0.4606.71(正式版本) (arm64)

使用框架: React

复现步骤

$ git clone https://github.com/shushu2013/taro-h5-bugs-example.git

$ cd taro-h5-bugs-example

$ yarn

$ npm run dev:h5

1、进入首页,快速来回点击底部 tabBar 的 『首页』和 『我的』菜单

2、底部 tabBar 菜单状态和 url 都变化了,页面却没有显示对应的 tab 页面

企业微信截图_7d455397-5392-4b25-94bc-15fa84d89a91

期望结果

来回切换 tabBar,页面内容显示正常

实际结果

来回切换 tabBar,页面内容显示不正常

环境信息

👽 Taro v3.3.10


  Taro CLI 3.3.10 environment info:
    System:
      OS: macOS 11.5.2
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 16.6.0 - ~/.nvm/versions/node/v16.6.0/bin/node
      Yarn: 1.22.11 - ~/.nvm/versions/node/v16.6.0/bin/yarn
      npm: 7.19.1 - ~/.nvm/versions/node/v16.6.0/bin/npm
    npmPackages:
      @tarojs/components: 3.3.10 => 3.3.10
      @tarojs/mini-runner: 3.3.10 => 3.3.10
      @tarojs/react: 3.3.10 => 3.3.10
      @tarojs/runtime: 3.3.10 => 3.3.10
      @tarojs/taro: 3.3.10 => 3.3.10
      @tarojs/webpack-runner: 3.3.10 => 3.3.10
      babel-preset-taro: 3.3.10 => 3.3.10
      eslint-config-taro: 3.3.10 => 3.3.10
      react: ^17.0.0 => 17.0.2

@Chen-jj
Copy link
Contributor

Chen-jj commented Oct 25, 2021

为了解决另一个问题,现在对跳转有设置一个 500ms 的 debounce,所以又带来了快速点击跳转时的问题。之后会对路由做一次重构,解决一系列问题

@Jesse-Fan
Copy link

为了解决另一个问题,现在对跳转有设置一个 500ms 的 debounce,所以又带来了快速点击跳转时的问题。之后会对路由做一次重构,解决一系列问题

所谓的之后是多久?

@Chen-jj Chen-jj mentioned this issue Oct 28, 2021
@Chen-jj
Copy link
Contributor

Chen-jj commented Oct 29, 2021

为了解决另一个问题,现在对跳转有设置一个 500ms 的 debounce,所以又带来了快速点击跳转时的问题。之后会对路由做一次重构,解决一系列问题

所谓的之后是多久?

这个 Q

@toFrankie
Copy link
Contributor

解决了吗,3.4.1 仍然有此问题,但不是快速切换,不快速切换也有此问题

@ZakaryCode ZakaryCode added this to Done in H5 Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x
Projects
Archived in project
H5
  
Done
Development

Successfully merging a pull request may close this issue.

6 participants