From 60ee9315e582ca7c56c72e17dcbd9ab837a455ec Mon Sep 17 00:00:00 2001 From: billionaireDY Date: Tue, 25 Jun 2024 16:02:57 +0900 Subject: [PATCH] [#noissue] fix: sidebar highlighting bug --- .../ui/src/components/Layout/LayoutWithSideNavigation.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web-frontend/src/main/v3/packages/ui/src/components/Layout/LayoutWithSideNavigation.tsx b/web-frontend/src/main/v3/packages/ui/src/components/Layout/LayoutWithSideNavigation.tsx index 6ba6ab5a013f..3a6edad491d3 100644 --- a/web-frontend/src/main/v3/packages/ui/src/components/Layout/LayoutWithSideNavigation.tsx +++ b/web-frontend/src/main/v3/packages/ui/src/components/Layout/LayoutWithSideNavigation.tsx @@ -57,7 +57,12 @@ export const LayoutWithSideNavigation = ({ const subMenuContentElement = hoverRef.current?.querySelector('.ps-submenu-content'); const isHover = useDebounce(useHover(hoverRef), 150); - const isActive = item.childItems?.some(({ href = '' }) => pathname.includes(href)); + const isActive = item.childItems?.some(({ href }) => { + if (href) { + return pathname.includes(href); + } + return false; + }); React.useEffect(() => { if (collapsed && subMenuContentElement) {