-
Notifications
You must be signed in to change notification settings - Fork 43
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
在手机上手指滚动屏幕的时候,会触发页面元素的点击事件 #8
Comments
单凭这句话我很难准确的定位真正的问题所在,不过我可以猜测一下: |
场景:页面元素中有按钮(我只监听onclick事件),手机上手指触屏滚动时,当手指刚好触到按钮的时候,会触发按钮的点击。 这个应该很容易重现到。 |
@fisherw |
。。。。 |
场景:在一个宫格页面,每个宫格绑定click事件,上滑或者下滑时可能会触发宫格的click事件。 injectEvent (event) {
if (eventType === EVENT_TYPE.touchend || eventType === EVENT_TYPE.touchcancel) {
// 阻止事件冒泡,避免在滚动时触发页面元素的click事件
event.cancelBubble = true
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
现象就是我滚着页面就触发了页面元素中的按钮点击,希望可以优化一下。
The text was updated successfully, but these errors were encountered: