swisnl / jQuery-contextMenu

jQuery contextMenu plugin & polyfill
https://swisnl.github.io/jQuery-contextMenu/
MIT License
2.24k stars 744 forks source link

In small window, menu overlaps mouse and mouseup immediately invokes a command #670

Open mattmccutchen opened 5 years ago

mattmccutchen commented 5 years ago

Thanks for this useful library. We've recently found what we would consider to be a bug. If the user right-clicks to trigger the menu and the browser window is small enough compared to the menu, then the menu may overlap the mouse when it opens, and the mouseup will immediately invoke a command, which is probably not what the user intended.

Here's a demo using the main demo page:

jquery-contextmenu-bug-2018-10-26_17 29 40

(In our actual application, the menu is bigger, so the window doesn't have to be quite so small for the problem to occur.)

In this scenario, there should be a minimum time that the mouse button has to be held down before a mouseup will invoke a command, or perhaps the first mouseup should never invoke a command and another click should always be required.

I tried to search for an existing issue report, but I may have the wrong search terms...

bbrala commented 5 years ago

Hmm, this seems like a bug indeed. Seems like some sort of check for timing is in order.