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

createSelectorQuery获取元素距离顶部高度,在滚动时,top值波动问题 #2608

Open
hebeillc opened this issue Sep 22, 2024 · 0 comments

Comments

@hebeillc
Copy link

NutUI React 包名

@nutui/nutui-react-taro

NutUI React 版本号

2.6.14

平台

weapp

重现链接

https://codesandbox.io/p/devbox/shopdetail-nx4c6d

重现步骤

WechatIMG331
WechatIMG332

期望的结果是什么?

期望实现tab跟随页面滚动被选中,滚动到评论区时,评论项被选中,滚动到商品区时,商品项被选中

实际的结果是什么?

滚动时,在商品区与评论区交界处出现tab来回选中切换的情况,debug后发现是元素的top值在滚动时不是递增递减,会出现大小波动的情况,在缓慢滚动时比较明显

环境信息

Taro CLI 4.0.5 environment info:
System:
OS: macOS 13.5
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.9.0 - ~/.nvm/versions/node/v22.9.0/bin/node
Yarn: 1.22.22 - ~/.nvm/versions/node/v22.9.0/bin/yarn
npm: 10.8.3 - ~/.nvm/versions/node/v22.9.0/bin/npm
npmPackages:
@tarojs/cli: 4.0.5 => 4.0.5
@tarojs/components: 4.0.5 => 4.0.5
@tarojs/helper: 4.0.5 => 4.0.5
@tarojs/plugin-framework-react: 4.0.5 => 4.0.5
@tarojs/plugin-html: 4.0.5 => 4.0.5
@tarojs/plugin-platform-alipay: 4.0.5 => 4.0.5
@tarojs/plugin-platform-h5: 4.0.5 => 4.0.5
@tarojs/plugin-platform-jd: 4.0.5 => 4.0.5
@tarojs/plugin-platform-qq: 4.0.5 => 4.0.5
@tarojs/plugin-platform-swan: 4.0.5 => 4.0.5
@tarojs/plugin-platform-tt: 4.0.5 => 4.0.5
@tarojs/plugin-platform-weapp: 4.0.5 => 4.0.5
@tarojs/react: 4.0.5 => 4.0.5
@tarojs/runtime: 4.0.5 => 4.0.5
@tarojs/shared: 4.0.5 => 4.0.5
@tarojs/taro: 4.0.5 => 4.0.5
@tarojs/taro-loader: 4.0.5 => 4.0.5
@tarojs/webpack5-runner: 4.0.5 => 4.0.5
babel-preset-taro: 4.0.5 => 4.0.5
eslint-config-taro: 4.0.5 => 4.0.5
react: ^18.0.0 => 18.3.1

其他补充信息

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant