From cfb7c2ddc680070836d60c6efbeff4a646b04432 Mon Sep 17 00:00:00 2001 From: Kari Lavikka Date: Fri, 10 Jan 2025 14:56:57 +0200 Subject: [PATCH] fix: allow subclone deselection when clicking outside the svg element --- src/gui/gui.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/gui.ts b/src/gui/gui.ts index 813f43c..ec43eec 100644 --- a/src/gui/gui.ts +++ b/src/gui/gui.ts @@ -246,6 +246,13 @@ export function setupGui( zoomController.updateDisplay(); }); + jellyfishPlotContainer.addEventListener("click", (event: MouseEvent) => { + // Allow deselection when clicking outside the plot + if (event.target === jellyfishPlotContainer) { + querySvg()?.dispatchEvent(new MouseEvent("click", event)); + } + }); + onZoomOrPan(); onPatientChange(); }