html - Jquery contextmenu event not working on ios/Safari -
i have button supposed trigger custom behaviour. therefore using jquery's contextmenu
event. please see fiddle.
currently binding event way:
$( "#mybutton" ).contextmenu(function() { alert( "handler .contextmenu() called." ); });
i tried bind this:
$( "#mybutton" ).on('contextmenu', function() { alert( "handler .contextmenu() called." ); });
as see in fiddle disabled default ios behaviour longpress using:
body { -webkit-touch-callout: none !important; } input { -webkit-user-select: none !important; }
i tested fiddle in:
- chrome, latest version on windows (using right-click , touch)
- chrome on android using taphold
- internet explorer, latest version on windows (using right-click , touch)
- opera, latest version on windows (using right-click , touch)
- firefox, latest version on windows (using right-click , touch)
- safari, on macos sierra, (using right-click)
all of above work expected. unfortunately, not work on ios/safari on ipad. current safari version 10.1.2
i tried debug connecting ipad mac , logging console output. seems event never fired.
i looked solutions unfortunately, solutions seem either using jquery-mobile's taphold
want avoid or writing custom timer-based event handlers not clean solution, imho.
has had similar experience , maybe found solution?
Comments
Post a Comment