Hi there,
I encountered a problem with my custom context menu. When I rightclick in firefox, the native context menu pops up on top. In chrome it is fine, but I need it to work with both browsers. What I’ve tried:
<div onContextMenu={(e) => {
e.preventDefault();
e.stopPropagation();
return false
}}/>
</div>
^ will block the context menu from popping up on a random div in chrome only
componentDidMount(){
document.addEventListener("contextmenu", function(e) {
if(e.target.nodeName && e.target.nodeName.toLowerCase() === "td") {
e.preventDefault();
e.stopPropagation();
}
}, true);
}
^ will block the CUSTOM context menu in chrome and firefox but not the firefox native one. Any other ideas on how I can use the context menu option in firefox?