fix: close navmenu on navigation
This commit is contained in:
@@ -153,6 +153,8 @@ export function DesktopNav({
|
||||
|
||||
useEffect(() => clearCloseTimer, [clearCloseTimer]);
|
||||
|
||||
useEffect(() => closeGroup(), [pathname, closeGroup]);
|
||||
|
||||
const columnLinks = useCallback((groupId: string): HTMLElement[] => {
|
||||
const nav = navRef.current;
|
||||
if (!nav) return [];
|
||||
@@ -490,6 +492,7 @@ export function DesktopNav({
|
||||
<Link
|
||||
to={child.href}
|
||||
data-nav-sublink=""
|
||||
onClick={closeGroup}
|
||||
aria-current={
|
||||
isCurrentPath(child.href, pathname) ? "page" : undefined
|
||||
}
|
||||
@@ -520,6 +523,7 @@ export function DesktopNav({
|
||||
isCurrentPath(item.href, pathname) ? "page" : undefined
|
||||
}
|
||||
onFocus={closeGroup}
|
||||
onClick={closeGroup}
|
||||
className={cx(
|
||||
"body-sm-bold whitespace-nowrap pb-[2px] no-underline",
|
||||
/* Same rest/hover/current treatment as a group trigger. */
|
||||
|
||||
Reference in New Issue
Block a user