jQuery-contextMenu icon indicating copy to clipboard operation
jQuery-contextMenu copied to clipboard

Add a "preShow" callback, to conditionally show context menu or not.

Open Mike-Benoit opened this issue 6 years ago • 3 comments

In our case we want the jquery context menu to appear if the user right-clicks anywhere on the screen, but have the browsers native context menu to appear if they right-click on a textarea, input box, or some other special element of our choosing. One of the main reasons is that if you turn off right-click to get to browser native copy/cut/paste/translate/etc... actions, users seem to complain pretty loudly.

I realize there are ways to get this behavior right now, but from my understanding they are pretty difficult in our case, specifically when the selector is dynamic and where their may be multiple different context menus registered.

As an easy work around, if you could simply register a "preShow" callback (I think jQuery-ui tabs does something like this), that passes in the event, and the current contextmenu object, we could then make any decisions we want and either cause the context menu to appear, not appear, or show the browser native context menu based on the return value of that callback.

Mike-Benoit avatar Oct 19 '18 21:10 Mike-Benoit

Yeah that is a great idea.

bbrala avatar Oct 22 '18 08:10 bbrala

I need it too. @bbrala

bshafiei-ir avatar May 26 '19 10:05 bshafiei-ir

I will make some time this week to get going on issues, have been a bit swamped lately.

bbrala avatar May 26 '19 14:05 bbrala