FeliciousX / vue-directive-long-press

Vue Directive for Long Press
MIT License
21 stars 9 forks source link

Need a way to determine right or left click #12

Open deviationist opened 5 years ago

deviationist commented 5 years ago

I'm working on a PWA that is used both on touch devices and computers. When right clicking a event that has a longpress-event binded to it, then "long-press-start" is triggered, but "long-press-stop" is never trigered, not until one click with the left button and the regular event cycle kicks in.

I solved this manually by listening for "window.oncontextmenu" to detect if the click is right or left, and the discard the long press event if the right button was used.

Would this be something that the longpress should detect, whether the right or left mouse button is clicked?

kiyui commented 5 years ago

This may be worth investigating :smile: Right now we are making use of pointer events, so it may be that clicking the right mouse button does not trigger a pointerup. Thanks for highlighting this issue!