From 927d6b3e61ffa005f99ad49f37971c9038caf38c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manish=20Kumar=20=E2=9B=84?= Date: Wed, 18 Jun 2025 00:41:21 +0900 Subject: [PATCH 1/3] fix(#7646): add default value if current page is missing in sidebar sometimes current page can be missing from navigation data if the entry is not present in the navigation.json file. In those cases it shows an empty select box on smaller screens. This PR chooses the first item in the navigation tree if the current page is missing from there --- packages/ui-components/Containers/Sidebar/index.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/ui-components/Containers/Sidebar/index.tsx b/packages/ui-components/Containers/Sidebar/index.tsx index 68b2404eb958c..c7769acef0294 100644 --- a/packages/ui-components/Containers/Sidebar/index.tsx +++ b/packages/ui-components/Containers/Sidebar/index.tsx @@ -31,9 +31,10 @@ const SideBar: FC> = ({ items: items.map(({ label, link }) => ({ value: link, label })), })); - const currentItem = selectItems - .flatMap(item => item.items) - .find(item => pathname === item.value); + const currentItem = + selectItems + .flatMap(item => item.items) + .find(item => pathname === item.value) || selectItems[0]?.items[0]; return (