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 React 通过setState改变页面数据渲染,ScrollView会自动滚动到顶部 #7947

Closed
SamChangi opened this issue Nov 1, 2020 · 0 comments
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-2 Version - 2.x
Projects

Comments

@SamChangi
Copy link

相关平台

H5

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

复现步骤

常规视图views外包裹ScrollView,setState改变state来控制不同内容的渲染。

期望结果

页面正常渲染,ScrollView的滚动条不会变动。

实际结果

结果导致ScrollView意外自动滚动到顶部。

环境信息

👽 Taro v2.2.15


  Taro CLI 2.2.15 environment info:
    System:
      OS: macOS 10.14.4
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.15.3 - /usr/local/bin/node
      Yarn: 1.19.1 - /usr/local/bin/yarn
      npm: 6.4.1 - /usr/local/bin/npm
    npmPackages:
      @tarojs/components: 2.2.15 => 2.2.15 
      @tarojs/components-qa: 2.2.15 => 2.2.15 
      @tarojs/mini-runner: 2.2.15 => 2.2.15 
      @tarojs/plugin-less: 2.2.15 => 2.2.15 
      @tarojs/plugin-sass: 2.2.15 => 2.2.15 
      @tarojs/plugin-uglify: 2.2.15 => 2.2.15 
      @tarojs/redux: 2.2.15 => 2.2.15 
      @tarojs/redux-h5: 2.2.15 => 2.2.15 
      @tarojs/router: 2.2.15 => 2.2.15 
      @tarojs/taro: 2.2.15 => 2.2.15 
      @tarojs/taro-weapp: 2.2.15 => 2.2.15 
      @tarojs/webpack-runner: 2.2.15 => 2.2.15 
      eslint-config-taro: 2.2.15 => 2.2.15 
      eslint-plugin-taro: 2.2.15 => 2.2.15 
      nerv-devtools: ^1.5.7 => 1.5.7 
      nervjs: ^1.5.7 => 1.5.7 
      stylelint-config-taro-rn: 2.2.15 => 2.2.15 
      stylelint-taro-rn: 2.2.15 => 2.2.15 
      taro-ui: ^2.2.7 => 2.3.4 

补充信息

@luckyadam
考虑产品在Taro2.x已趋于稳定,不考虑升级去3.x,测试Taro2.x都存在这个问题。

@taro-bot2 taro-bot2 bot added F-react Framework - React T-h5 Target - 编译到 H5 V-2 Version - 2.x labels Nov 1, 2020
@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-2 Version - 2.x
Projects
Archived in project
H5
  
Done
Development

No branches or pull requests

1 participant