ol-contextmenu icon indicating copy to clipboard operation
ol-contextmenu copied to clipboard

Long press doesn't work in Firefox mobile

Open mstenta opened this issue 6 years ago • 4 comments

Great library! I'm excited to try it out! I noticed in testing it on my mobile device, however, that the long-press does not work to open the contextmenu in Firefox. Long-press does work in Chrome on mobile, though. Is this a browser issue, and Chrome just handles long-press as a right-click (but Firefox doesn't)? Or does the library itself handle the long-press?

mstenta avatar Jul 16 '19 16:07 mstenta

Hey @mstenta would you be able to debug this one? :)

jonataswalker avatar Jul 17 '19 13:07 jonataswalker

Perhaps! Question though: does the library have code to specifically handle a long mouse click? Or do you think it is Chrome that is handling that and interpreting it as a right click?

If it's Chrome, then I think this would be a feature request for the library, not a bug report, because the library does not currently handle long-press clicks itself (correct?)

mstenta avatar Jul 17 '19 13:07 mstenta

Correct. We're not handling this "event" at all. As far as I know there's no such event, you gotta play with setInterval and setTimeout and trigger the menu.

What do you think?

jonataswalker avatar Jul 18 '19 23:07 jonataswalker

Maybe something like this?

https://github.com/ittus/vue-long-click/blob/master/src/directives/longclick.js

jonataswalker avatar Jul 18 '19 23:07 jonataswalker

Closing due to inactivity.

jonataswalker avatar Mar 11 '23 12:03 jonataswalker