From 96c1d427cdd0c9d4e7d2f4d037f21ca0f419563e Mon Sep 17 00:00:00 2001 From: Theo Sanderson Date: Thu, 12 Dec 2024 18:29:50 +0000 Subject: [PATCH] update --- gensplore-component/src/components/GensploreView.jsx | 4 ++-- gensplore-component/src/components/SingleRow.jsx | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) 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 =