fix(sidebar): improve active child route matching logic (#13121)

This commit is contained in:
Gabriel Jablonski
2026-04-16 02:27:16 -03:00
committed by GitHub
parent 97dae52841
commit cc008951db

View File

@@ -158,9 +158,11 @@ const activeChild = computed(() => {
return rankedPage ?? activeOnPages[0]; return rankedPage ?? activeOnPages[0];
} }
return navigableChildren.value.find( return navigableChildren.value.find(child => {
child => child.to && route.path.startsWith(resolvePath(child.to)) if (!child.to) return false;
); const childPath = resolvePath(child.to);
return route.path === childPath || route.path.startsWith(`${childPath}/`);
});
}); });
const hasActiveChild = computed(() => { const hasActiveChild = computed(() => {