Jquery contextmenu event not working on ios/Safari, instead long press is opening the default copy-paste menu

Viewed 137

I have a div which is supposed to open a custom menu. Therefore I am using Jquery's contextmenu event.

Currently I am binding the event this way:

$( "#idDiv" ).contextmenu(function() {
  alert( "Handler for .contextmenu() called." );
});

I also tried to bind it like this:

$( "#idDiv" ).on('contextmenu', function() {
   alert( "Handler for .contextmenu() called." );
});

I even tried disabling the default ios behaviour for longpress by using:

body { -webkit-touch-callout: none !important; }
input { -webkit-user-select: none !important; }

Still it didn't work. Can anyone help me with this?

0 Answers
Related