mirror of
https://github.com/outline/outline.git
synced 2026-11-28 16:19:46 +03:00
fix: click name to toggle expanded when on collection or document page (#10713)
This commit is contained in:
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}
|
||||
|
||||
Reference in new issue
Block a user