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

h5 从非tabbar页面回跳到tabbar页面,点击浏览器返回按钮页面白屏 #12455

Closed
bluescurry opened this issue Sep 7, 2022 · 8 comments
Labels
A-router Area - H5 路由相关 F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x

Comments

@bluescurry
Copy link
Contributor

相关平台

H5

复现仓库

https://github.com/bluescurry/taro-debug
浏览器版本: Chrome 104.0.5112.101
使用框架: React

复现步骤

  1. 从首页点击“跳转到商品页”进入商品页
  2. 在商品页点击“点击返回首页”返回首页
  3. 在点击浏览器返回

期望结果

直接从商品页返回首页

实际结果

又打开了一个首页地址,点浏览器返回就返回到了上一个首页,并且白屏了

环境信息

👽 Taro v3.4.8

Browserslist: caniuse-lite is outdated. Please run:
  npx browserslist@latest --update-db
  Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating

  Taro CLI 3.4.8 environment info:
    System:
      OS: macOS 12.5
      Shell: 5.8.1 - /bin/zsh
    Binaries:
      Node: 16.15.1 - /usr/local/bin/node
      Yarn: 1.22.15 - /usr/local/bin/yarn
      npm: 8.11.0 - /usr/local/bin/npm
    npmPackages:
      @tarojs/cli: 3.4.8 => 3.4.8
      @tarojs/components: 3.4.8 => 3.4.8
      @tarojs/mini-runner: 3.4.8 => 3.4.8
      @tarojs/plugin-framework-react: 3.4.8 => 3.4.8
      @tarojs/react: 3.4.8 => 3.4.8
      @tarojs/runtime: 3.4.8 => 3.4.8
      @tarojs/taro: 3.4.8 => 3.4.8
      @tarojs/webpack-runner: 3.4.8 => 3.4.8
      babel-preset-taro: 3.4.8 => 3.4.8
      eslint-config-taro: 3.4.8 => 3.4.8
      react: ^17.0.0 => 17.0.2

补充信息

从商品页返回首页是通过 switchTab 跳转的,就会有问题,通过 navigateBack 回跳是可以的,但是这种做法在小程序是不行的,会报错,tabbar 页面只能通过 switchTab 跳转。
这里有录屏:
录屏

@taro-bot2 taro-bot2 bot added F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x labels Sep 7, 2022
@Lycyc
Copy link

Lycyc commented Sep 8, 2022

我也是 用tabBar白屏 是因为外层的.taro-page 的display:none 没有删除 不知道怎么解决

@ZakaryCode
Copy link
Contributor

可尝试升级版本修复该问题

@bluescurry
Copy link
Contributor Author

可尝试升级版本修复该问题

请问要升级到什么版本?

@taro-bot2 taro-bot2 bot removed the to be closed label Sep 13, 2022
@liuliuna
Copy link

这个问题目前修复了吗 我看还是open状态

@liuliuna
Copy link

可尝试升级版本修复该问题

要升级到什么版本?

老哥解决了吗这个

@bluescurry
Copy link
Contributor Author

可尝试升级版本修复该问题

要升级到什么版本?

老哥解决了吗这个

没解决,我升级到了3.4.x的最新版本还是不行,没试升到3.5行不行,因为升3.5改动会比较大

@Lycyc
Copy link

Lycyc commented Oct 31, 2022 via email

@ZakaryCode ZakaryCode added the A-router Area - H5 路由相关 label Nov 7, 2022
@ZakaryCode
Copy link
Contributor

从商品页返回首页是通过 switchTab 跳转的,就会有问题,通过 navigateBack 回跳是可以的,但是这种做法在小程序是不行的,会报错,tabbar 页面只能通过 switchTab 跳转。

switchTab 不能移除浏览器路由栈直接返回到上一次展示的路由页面,这是由于浏览器自身规则限制不可能修复,请规避该逻辑。

没解决,我升级到了3.4.x的最新版本还是不行,没试升到3.5行不行,因为升3.5改动会比较大

升级 3.5 实际并不会有特别大变动,遵循升级指南就可以规避,如果希望和 3.4 一致,也可以选择关闭 prebundle 等特性。

@ZakaryCode ZakaryCode added this to H5 Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-router Area - H5 路由相关 F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x
Projects
Archived in project
Development

No branches or pull requests

4 participants