We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
[email protected]:xty1992a/page-scroll-bug.git 浏览器版本: 任意版本 使用框架: React
一次滚动到位
不能滚动到指定位置
Taro CLI 3.6.2 environment info: System: OS: macOS 15.1.1 Shell: 5.9 - /bin/zsh Binaries: Node: 18.20.4 - ~/.nvm/versions/node/v18.20.4/bin/node Yarn: 1.22.22 - ~/.nvm/versions/node/v18.20.4/bin/yarn npm: 10.7.0 - ~/.nvm/versions/node/v18.20.4/bin/npm npmPackages: @tarojs/cli: 3.6.35 => 3.6.35 @tarojs/components: 3.6.35 => 3.6.35 @tarojs/helper: 3.6.35 => 3.6.35 @tarojs/plugin-framework-react: 3.6.35 => 3.6.35 @tarojs/plugin-platform-alipay: 3.6.35 => 3.6.35 @tarojs/plugin-platform-h5: 3.6.35 => 3.6.35 @tarojs/plugin-platform-jd: 3.6.35 => 3.6.35 @tarojs/plugin-platform-qq: 3.6.35 => 3.6.35 @tarojs/plugin-platform-swan: 3.6.35 => 3.6.35 @tarojs/plugin-platform-tt: 3.6.35 => 3.6.35 @tarojs/plugin-platform-weapp: 3.6.35 => 3.6.35 @tarojs/react: 3.6.35 => 3.6.35 @tarojs/runtime: 3.6.35 => 3.6.35 @tarojs/service: 3.6.35 => 3.6.35 @tarojs/shared: 3.6.35 => 3.6.35 @tarojs/taro: 3.6.35 => 3.6.35 @tarojs/taro-h5: 3.6.35 => 3.6.35 @tarojs/webpack5-runner: 3.6.35 => 3.6.35 babel-preset-taro: 3.6.35 => 3.6.35 eslint-config-taro: 3.6.35 => 3.6.35 react: ^18.2.0 => 18.3.1
排查后发现是 taro-h5 的pageScrollTo实现有问题,代码位置packages/taro-h5/src/api/ui/scroll/index.ts
packages/taro-h5/src/api/ui/scroll/index.ts
const delta = to - from // fixme 此值可能不是整数 const frameCnt = duration / FRAME_DURATION const easeFunc = getTimingFunc(easeInOut, frameCnt) const scroll = (frame = 0) => { const dest = from delta * easeFunc(frame) scrollFunc(dest) if (frame < frameCnt) { timer && clearTimeout(timer) timer = setTimeout(() => { scroll(frame 1) }, FRAME_DURATION) } else { // 修复,上面已经缓动到附近了,直接滚多一次到终点即可 // scrollFunc(to) return handle.success({}, { resolve, reject }) } } scroll()
The text was updated successfully, but these errors were encountered:
PS. 补充另一个 bug,与编译有关,在我们项目仓库可以稳定复现,起新仓库无法复现,因此在这里补充一下,如不符合规范也请回复一下,我另开 issues。
Sorry, something went wrong.
No branches or pull requests
相关平台
H5
复现仓库
[email protected]:xty1992a/page-scroll-bug.git
浏览器版本: 任意版本
使用框架: React
复现步骤
期望结果
一次滚动到位
实际结果
不能滚动到指定位置
环境信息
补充信息
排查后发现是 taro-h5 的pageScrollTo实现有问题,代码位置
packages/taro-h5/src/api/ui/scroll/index.ts
The text was updated successfully, but these errors were encountered: