fix: click name to toggle expanded when on collection or document page (#10713)

This commit is contained in:
Salihu authored and GitHub committed 2025-11-25 01:43:35 +01:00
1 parent 8ba1dfb708
commit 74f66af232
1 file changed
+10
@@ -160,6 +160,15 @@ const NavLink = ({
[onClick, navigateTo, isActive, shouldFastClick]
);
const handleClick = React.useCallback(
(event: React.MouseEvent<HTMLAnchorElement>) => {
if (isActive) {
event.preventDefault();
}
},
[isActive]
);
React.useEffect(() => {
setPreActive(undefined);
}, [currentLocation]);
@@ -181,6 +190,7 @@ const NavLink = ({
// Note do not use `onPointerDown` here as it makes the mobile sidebar unscrollable
onMouseDown={handleMouseDown}
onKeyDown={handleKeyDown}
onClick={handleClick}
aria-current={(isActive && ariaCurrent) || undefined}
className={className}
style={style}