-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
taro h5页面监听不了滚动scroll事 #2416
Comments
欢迎提交 Issue~ 如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏 如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。 Good luck and happy coding~ |
你的页面高度是多少 |
html,body,#app是100% ip6 667 |
你的页面够高么,出滚动条了么 |
有滚动条 |
里面内容高度是3570 |
试下对.taro-tabbar__panel进行监听 |
@schinvendy 居然能触发,你也是这样做的吗? |
是的,之前做H5的刷新和滚动加载时发现直接在windows上监听事件无效,观察下H5的html结构后就对.taro-tabbar__panel进行监听来实现了。 |
@schinvendy taro_router这样就相当于文档的高度了是吧。taro-tabbar__panel相当于window屏幕的高度,通过taro-tabbar__panel.scrollTop+taro-tabbar__panel.offsetHeight>=taro_router-100就相当于滚动到底部 |
document.body.addEventListener("scroll",this.scrollpage) 这个可以 |
问题描述
在h5环境下,在页面的componentDidMount中兼容window的滚动事件不执行,而touchend事件会执行
复现步骤
期望行为
能监听页面的滚动事件
报错信息
无,能打印touchend,打印不出scroll
系统信息
补充信息
无
The text was updated successfully, but these errors were encountered: