From 9734ad1e519f1d6a730d481424aabe3ad0f3d578 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Wed, 21 Aug 2024 12:52:13 +0300 Subject: [PATCH] docs: fix category not opening in api reference from algolia search (#8690) --- www/apps/api-reference/components/Tags/Section/index.tsx | 1 + .../docs-ui/src/components/Sidebar/Item/Category/index.tsx | 2 +- www/packages/docs-ui/src/providers/Sidebar/index.tsx | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/www/apps/api-reference/components/Tags/Section/index.tsx b/www/apps/api-reference/components/Tags/Section/index.tsx index 2df1740673..e4723b73b5 100644 --- a/www/apps/api-reference/components/Tags/Section/index.tsx +++ b/www/apps/api-reference/components/Tags/Section/index.tsx @@ -143,6 +143,7 @@ const TagSection = ({ tag }: TagSectionProps) => { }} pathName={pathname} reportLink={formatReportLink(area, tag.name)} + vertical /> } diff --git a/www/packages/docs-ui/src/components/Sidebar/Item/Category/index.tsx b/www/packages/docs-ui/src/components/Sidebar/Item/Category/index.tsx index bcf2d1939d..fd283b9abf 100644 --- a/www/packages/docs-ui/src/components/Sidebar/Item/Category/index.tsx +++ b/www/packages/docs-ui/src/components/Sidebar/Item/Category/index.tsx @@ -47,7 +47,7 @@ export const SidebarItemCategory = ({ if (isActive && !open) { setOpen(true) } - }, [isChildrenActive]) + }, [isChildrenActive, item.children]) useEffect(() => { if (!persistState) { diff --git a/www/packages/docs-ui/src/providers/Sidebar/index.tsx b/www/packages/docs-ui/src/providers/Sidebar/index.tsx index 4c36294748..2a6bfe1b2c 100644 --- a/www/packages/docs-ui/src/providers/Sidebar/index.tsx +++ b/www/packages/docs-ui/src/providers/Sidebar/index.tsx @@ -530,7 +530,7 @@ export const SidebarProvider = ({ activePath, setActivePath, isLinkActive: isLinkActive, - isChildrenActive: isChildrenActive, + isChildrenActive, findItemInSection, mobileSidebarOpen, setMobileSidebarOpen,