swisnl / jQuery-contextMenu

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

Right Click when text is highlighted #713

Closed wegoodwin closed 4 years ago

wegoodwin commented 4 years ago

Hi,

I would like to have the contextmenu appear only when the user has selected a word. Is this possible?

bbrala commented 4 years ago

You could use one of the open events to see if there is selected text on the page, then return false if it doesn't. Check out the docs for the events: https://swisnl.github.io/jQuery-contextMenu/docs.html#events