From 3a92f5afba9f414837e7e62024c2da69aeca4a3c Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 30 Jun 2025 09:29:57 +0100 Subject: [PATCH] try and make preset menu always clickable --- dicom-viewer/src/App.tsx | 174 +++++++++++++++++++++------------------ 1 file changed, 92 insertions(+), 82 deletions(-) diff --git a/dicom-viewer/src/App.tsx b/dicom-viewer/src/App.tsx index 734edce..2ac5a02 100644 --- a/dicom-viewer/src/App.tsx +++ b/dicom-viewer/src/App.tsx @@ -407,7 +407,7 @@ function App({ container_id, imageStacks, autoCacheStack, annotationJson, viewer total: number, windowCenter: string, windowWidth: string, - slicePosition?: number, + slicePosition: string, }>>(() => Array(viewportGrid.rows * viewportGrid.cols).fill({ index: 0, @@ -2018,7 +2018,10 @@ function App({ container_id, imageStacks, autoCacheStack, annotationJson, viewer // cursor: "pointer", zIndex: activeViewport === i ? 10 : 1, }} - onClick={() => setActiveViewport(i)} + onClick={() => { + setActiveViewport(i); + setViewportMenuOpen(false); // <-- Add this line to close the grid selector + }} onDoubleClick={() => handleDoubleClick(i)} > - ))} - - )} - - + {preset.name} + + ))} + + )} + + {/* Position bar inside each viewport */} {viewportModes[i] === "stack" && viewportImageIds[i] && (