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] && (