Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Small fix on header navigation

Carlos Monastyrski9f8be1499535
diff --git a/frontend/src/components/v3/generic/Sidebar/Sidebar.tsx b/frontend/src/components/v3/generic/Sidebar/Sidebar.tsx
index 9221425ebe..b103277185 100644
--- a/frontend/src/components/v3/generic/Sidebar/Sidebar.tsx
+++ b/frontend/src/components/v3/generic/Sidebar/Sidebar.tsx
@@ -526,11 +526,16 @@ function SidebarCollapsibleGroup({
const { state, isMobile } = useSidebar();
const isCollapsed = state === "collapsed" && !isMobile;
const contentRef = React.useRef<HTMLDivElement>(null);
+ const previousHasActiveChildRef = React.useRef<boolean | undefined>(undefined);
React.useEffect(() => {
- if (isOpen || isCollapsed) return;
- const hasActiveChild = contentRef.current?.querySelector('[data-active="true"]');
- if (hasActiveChild) setIsOpen(true);
+ if (isCollapsed) return;
+ const hasActiveChild = !!contentRef.current?.querySelector('[data-active="true"]');
+ const previous = previousHasActiveChildRef.current;
+ if (hasActiveChild && previous !== true && !isOpen) {
+ setIsOpen(true);
+ }
+ previousHasActiveChildRef.current = hasActiveChild;
});
const abbreviation =