swisnl / jQuery-contextMenu

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

Create Context Menu (asynchronous) demo doesn't work with right-click #735

Open ericprud opened 3 years ago

ericprud commented 3 years ago

In documentation/demo/async-create, the button says "right click me" but doesn't behave as expected in:

The async-create demo builds the items immediately upon click event. I think the common use case is that the items take a while to construct and that $this.contextmenu() is fired when they're ready.

Also, the captured event is mouseup, which means it doesn't translate to common cases where folks need mouseup and contextmenu to be different. Switching the event to contextmenu would address this but you theen need to disable the contextmenu handler during execution because the call to $this.contextmenu() triggers it again.

8 addresses these points with a new demo, which could be moved to async-create.md to remedy the above issues.