diff --git a/gensplore-component/src/components/GensploreView.jsx b/gensplore-component/src/components/GensploreView.jsx index 48e9572..223a0ce 100644 --- a/gensplore-component/src/components/GensploreView.jsx +++ b/gensplore-component/src/components/GensploreView.jsx @@ -337,9 +337,9 @@ if (hit1 === -1) { // Handle context menu const handleContextMenu = (e) => { e.preventDefault(); - if (whereMouseWentDown !== null && whereMouseWentUp !== null) { + setContextMenu({ x: e.clientX, y: e.clientY }); - } + }; const handleCloseContextMenu = () => { diff --git a/gensplore-component/src/components/SingleRow.jsx b/gensplore-component/src/components/SingleRow.jsx index 1f16617..a41abf6 100644 --- a/gensplore-component/src/components/SingleRow.jsx +++ b/gensplore-component/src/components/SingleRow.jsx @@ -523,6 +523,10 @@ const SingleRow = ({ ...(isSelected ? { backgroundColor: "#ffffee" } : {}), }} onMouseDown={(e) => { + // if right mouse button, don't do anything + if (e.button == 2) { + return; + } // figure out which nucleotide was clicked const x = e.clientX - e.currentTarget.getBoundingClientRect().left; const nucleotide = @@ -532,6 +536,10 @@ const SingleRow = ({ e.preventDefault(); }} onMouseUp={(e) => { + // if right mouse button, don't do anything + if (e.button == 2) { + return; + } // figure out which nucleotide was clicked const x = e.clientX - e.currentTarget.getBoundingClientRect().left; const nucleotide =