diff --git a/frontend/src/pages/LinkMLViewerPage.tsx b/frontend/src/pages/LinkMLViewerPage.tsx index 1ba6b5135a..e17a948d3f 100644 --- a/frontend/src/pages/LinkMLViewerPage.tsx +++ b/frontend/src/pages/LinkMLViewerPage.tsx @@ -1691,6 +1691,8 @@ const LinkMLViewerPage: React.FC = () => { const navigateToClass = useCallback((className: string) => { setSearchParams({ class: className }); setHighlightedClass(className); + // Close any open ontology popup when navigating + setOntologyPopupCurie(null); // Find and select the class file const classFile = categories @@ -1708,6 +1710,8 @@ const LinkMLViewerPage: React.FC = () => { const navigateToEnum = useCallback((enumName: string) => { setSearchParams({ enum: enumName }); setHighlightedClass(enumName); // Reuse highlight state for enums + // Close any open ontology popup when navigating + setOntologyPopupCurie(null); // Find and select the enum file const enumFile = categories @@ -1725,6 +1729,8 @@ const LinkMLViewerPage: React.FC = () => { const navigateToSlot = useCallback((slotName: string) => { setSearchParams({ slot: slotName }); setHighlightedClass(slotName); // Reuse highlight state for slots + // Close any open ontology popup when navigating + setOntologyPopupCurie(null); // Find and select the slot file const slotFile = categories @@ -3654,8 +3660,9 @@ const LinkMLViewerPage: React.FC = () => { } else if (category.name === 'slot') { navigateToSlot(file.name); } else { - // For main schemas, clear the deep link params + // For main schemas, clear the deep link params and close any popup setSearchParams({}); + setOntologyPopupCurie(null); } }} >