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.0 使用virtuallist 在ios上抖动严重 #8125

Closed
summerNa opened this issue Nov 25, 2020 · 15 comments
Closed

taro3.0 使用virtuallist 在ios上抖动严重 #8125

summerNa opened this issue Nov 25, 2020 · 15 comments
Assignees
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@summerNa
Copy link

相关平台

微信小程序

小程序基础库: 2.14.0
使用框架: React

复现步骤

复制官方的virtuallist代码示例,在iOS手机上滑动就抖动很明显,安卓上没问题

期望结果

iOS手机上不要抖动

实际结果

iOS手机抖动明显

环境信息

Taro v3.0.5
  Taro CLI 3.0.5 environment info:
    System:
      OS: macOS 10.14
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 10.15.0 - /usr/local/bin/node
      Yarn: 1.17.3 - /usr/local/bin/yarn
      npm: 6.8.0 - /usr/local/bin/npm
    npmPackages:
      @tarojs/components: 3.0.9 => 3.0.5
      @tarojs/mini-runner: 3.0.9 => 3.0.5
      @tarojs/react: 3.0.9 => 3.0.5
      @tarojs/runtime: 3.0.9 => 3.0.5
      @tarojs/taro: 3.0.9 => 3.0.5
      @tarojs/webpack-runner: 3.0.9 => 3.0.5
      babel-preset-taro: 3.0.9 => 3.0.5
      eslint-config-taro: 3.0.9 => 3.0.5
      react: ^16.10.0 => 16.14.0
    npmGlobalPackages:
      typescript: 3.1.3
@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Nov 25, 2020
@luckyadam
Copy link
Member

升级到最新版本试试

@summerNa
Copy link
Author

升级到最新版本已解决

@beysong
Copy link

beysong commented Feb 24, 2021

又抖动了。。。v3.0.28

@Billy96
Copy link

Billy96 commented Feb 25, 2021

3.0.23不会抖动,升级到3.1.0就出现抖动

@leo43555483
Copy link

又抖动了。。。v3.0.28

3.0.28这个版本对scrollTo后滚动返回顶部做了修复。在scrollTo后滚动会强制设置scrollview的scrolltop,但是这样好像会引起不期望的rerender然后就会抖动。

@Chen-jj
Copy link
Contributor

Chen-jj commented Feb 25, 2021

我们再看一下的。

@Chen-jj Chen-jj reopened this Feb 25, 2021
@Chen-jj
Copy link
Contributor

Chen-jj commented Feb 26, 2021

@leo43555483 可以提供一个可复现的 demo 么~

@leo43555483
Copy link

@leo43555483 可以提供一个可复现的 demo 么~

公司项目不太方便,我用virtuallist文档提供的demo代码测试滚动会有轻微抖动。

@liuguichi
Copy link

Taro 3.1.0 问题依然存在

@leo43555483
Copy link

我们再看一下的。
奇怪的是我在使用旧版virtualList时使用类似于3.0.28设置scrollTop的方式解决了scrollTo回跳的问题。
//调用scrollTo的时候 if(this.state.scrollTop !== to) { this.virtualList.current.scrollTo(to) this.setState({scrollTop: to}) } else { this.virtualList.current.scrollTo(to) this.setState({scrollTop: to}) }
然后
`

` 在我的项目中暂时未发现问题,不知是否会提供线索。

不好意思之前用手机回复打错了,应该是
`//调用scrollTo的时候

if(this.state.scrollTop !== to) {
this.virtualList.current.scrollTo(to)
this.setState({scrollTop: to})
} else {
this.virtualList.current.scrollTo(to+1)
this.setState({scrollTop: to+1})
}`

然后

<VirtualList scrollTop={this.state.scrollTop}>

@ding991
Copy link

ding991 commented Mar 11, 2021

@Chen-jj Taro 3.1.2存在此问题,ios和android模拟器都存在此问题,回退版本到3.0.27无此问题。VirtualList示例单独运行无问题,但是有其他dom元素存在时,滑动列表,列表上下抖动,其scroll-to的值会一直变化。

@hcweb
Copy link

hcweb commented Apr 18, 2021

@Chen-jj 3.2.1依然抖动很厉害呀

@yz1311
Copy link

yz1311 commented Apr 27, 2021

+1 抖抖抖

@Chen-jj
Copy link
Contributor

Chen-jj commented Apr 27, 2021

3.2.6 应该解决了

@Chen-jj Chen-jj closed this as completed Apr 27, 2021
@Chen-jj
Copy link
Contributor

Chen-jj commented Apr 27, 2021

Duplicate of #8936

@Chen-jj Chen-jj marked this as a duplicate of #8936 Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

No branches or pull requests