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

useLongPress的moveThreshold支持对onclick生效 #2166

Open
dislido opened this issue Apr 20, 2023 · 5 comments
Open

useLongPress的moveThreshold支持对onclick生效 #2166

dislido opened this issue Apr 20, 2023 · 5 comments
Assignees

Comments

@dislido
Copy link

dislido commented Apr 20, 2023

移动端上下滑动页面时,松手后会触发onclick
moveThreshold似乎只对longPress生效,是否可以添加对onclick的支持或解决方案

@dislido
Copy link
Author

dislido commented Apr 20, 2023

原本的onclick事件本身不会在屏幕滑动时触发,应该是因为useLongPress使用mouseleave/touchend模拟click导致触发了事件

@liuyib
Copy link
Collaborator

liuyib commented Apr 20, 2023

和这个问题差不多:#2133
快速滑动时,类似于点击了,导致 moveThreshold 生效不了,目前来看是这样的原因,还在进一步确认中。

@liuyib liuyib self-assigned this Apr 20, 2023
@CYeas
Copy link

CYeas commented Apr 23, 2023

是有一点像?但我那边其实不用速度很快也能复现,而且触发的是longpress,只是可能手指不能上下滑动。这边debug的情况就是在slide的时候横向滑动被native拦截了,马上触发了touchcancel,webview与手指的相对位置并没有变化,所以浏览器没有认为是move,touchmove没有触发,在响应的上下文去debug event的position实际上也没有变化,所以那个pr就处理了下touchcancel的case

@liuyib
Copy link
Collaborator

liuyib commented Apr 23, 2023

之前我好像确实理解错了,我再排查下这个问题

@xmsz-stu
Copy link

xmsz-stu commented Nov 7, 2023

现在情况如何了

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

4 participants