Skip to content

Commit e208f0b

Browse files
committed
Fix bug with page highlight
1 parent a7fe88f commit e208f0b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎app/components/Index.tsx‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,11 @@ export default function Index({
159159

160160
{/* Individual reference items */}
161161
{isCategoryExpanded && categorySection.items.map((item) => {
162-
const itemPath = `/docs/reference/${typeSection.type}/${categorySection.category}/${item.reference.split('/').pop()}`;
163-
const isItemActive = pathname === itemPath;
162+
const itemFilename = item.reference.split('/').pop();
163+
const itemPath = `/docs/reference/${typeSection.type}/${categorySection.category}/${itemFilename}`;
164+
// Decode pathname to match against the constructed path
165+
const decodedPathname = decodeURIComponent(pathname);
166+
const isItemActive = decodedPathname === itemPath || pathname === itemPath;
164167

165168
return (
166169
<div key={item.reference} className="flex items-center pl-10 ml-4">

0 commit comments

Comments
 (0)