From 74f66af232e86a7d00549ea007553927dedd398a Mon Sep 17 00:00:00 2001 From: Salihu <91833785+salihudickson@users.noreply.github.com> Date: Tue, 25 Nov 2025 01:43:35 +0100 Subject: [PATCH] fix: click name to toggle expanded when on collection or document page (#10713) --- app/components/Sidebar/components/NavLink.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/components/Sidebar/components/NavLink.tsx b/app/components/Sidebar/components/NavLink.tsx index b72f8e7401..606d045195 100644 --- a/app/components/Sidebar/components/NavLink.tsx +++ b/app/components/Sidebar/components/NavLink.tsx @@ -160,6 +160,15 @@ const NavLink = ({ [onClick, navigateTo, isActive, shouldFastClick] ); + const handleClick = React.useCallback( + (event: React.MouseEvent) => { + 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}