Closed cplaiu closed 3 years ago
I am creating a context menu container where user right click and can add folders. All this folders appears above this container and I'm trying to prevent display contextmenu on it.
I have tried to prevent diplay menu using this code:
$(document).on("contextmenu", ".folder-box", function(e){ e.preventDefault(); $('.context-block').contextMenu(false); }); $(document).on("contextmenu", ".context-block", function(e){ e.preventDefault(); $('.context-block').contextMenu(true); });
but the context menu is still showing when right clicking.
CodePen Example
changing e.preventDefault(); is return false; working
e.preventDefault();
return false;
I am creating a context menu container where user right click and can add folders. All this folders appears above this container and I'm trying to prevent display contextmenu on it.
I have tried to prevent diplay menu using this code:
but the context menu is still showing when right clicking.
CodePen Example