swisnl / jQuery-contextMenu

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

Opening overlapping submenu on mobile triggers sub-item action #693

Open klues opened 5 years ago

klues commented 5 years ago

Steps to reproduce:

  1. go to https://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html in Chrome
  2. open Developer tools (Ctrl + Shift + I)
  3. use mobile device view (Ctrl + Shift + M)
  4. Use a quite small device, e.g. Galaxy S5
  5. Open the context menu of the demo by long tap
  6. Select "Sub-Group" by tap
  7. Alert opens -> sub-item of "Sub-Group" has been selected because it's positioned above the "Sub-Group" item and somehow the tap directly triggers the action of the overlapping element without even showing the submenu
bbrala commented 5 years ago

Hmm, yeah that is a problem. I checked your PR and it seems you add a delay after opening. Not sure if that is the way to get that fixed.

klues commented 5 years ago

Yeah, I've added a timeout of 100ms where the unintended action is ignored. For sure it's not a pretty solution, but it works. Feel free to change it to a more beautiful solution.