-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 中 query.selectViewport().scrollOffset() 的 scrollTop 始终返回 0 #7553
Comments
taro-bot2
bot
added
F-react
Framework - React
T-h5
Target - 编译到 H5
V-3
Version - 3.x
labels
Sep 8, 2020
yuezk
changed the title
H5 中,Sep 8, 2020
query.selectViewport().scrollOffset()
不能返回期望的值query.selectViewport().scrollOffset()
的 scrollTop
始终返回 0
yuezk
changed the title
H5 中,
H5 中 query.selectViewport().scrollOffset() 的 scrollTop 始终返回 0
Sep 8, 2020
query.selectViewport().scrollOffset()
的 scrollTop
始终返回 0
4 tasks
ZakaryCode
added a commit
that referenced
this issue
Jan 4, 2022
ZakaryCode
added a commit
that referenced
this issue
Jan 6, 2022
ZakaryCode
added a commit
that referenced
this issue
Jan 6, 2022
(cherry picked from commit 4164792)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
相关平台
H5
复现仓库
https://github.com/yuezk/taro_bug
浏览器版本: Chrome 84
使用框架: React
复现步骤
h5_selectViewport
目录yarn install && yarn dev:h5
Call query.selectViewport().scrollOffset()
按钮,会弹出当前页面的scrollTop
的值,为0
0
期望结果
正确的 scrollTop 的值
实际结果
一直是 0
环境信息
补充信息
现在由于
.taro_tabbar__panel
变成了可以滚动的容器 (#7435),html 标签变成了不滚动的了,调query.selectViewport().scrollOffset()
拿到的 scrollTop 的值始终是 0,为了兼容,目前只能写成下面这样:The text was updated successfully, but these errors were encountered: