mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 17:13:31 +01:00
fix: wrong active item after anchor select
This commit is contained in:
@@ -102,6 +102,8 @@ export function SidebarItems({
|
||||
const { classes } = useStyles();
|
||||
const groupItems = groupMembers(members);
|
||||
|
||||
const asPathWithoutQueryAndAnchor = router.asPath.split('?')[0]?.split('#')[0];
|
||||
|
||||
return (
|
||||
<>
|
||||
{(Object.keys(groupItems) as (keyof GroupedMembers)[])
|
||||
@@ -126,7 +128,7 @@ export function SidebarItems({
|
||||
) : null}
|
||||
</Group>
|
||||
}
|
||||
active={router.asPath === member.path}
|
||||
active={asPathWithoutQueryAndAnchor === member.path}
|
||||
variant="filled"
|
||||
></NavLink>
|
||||
</Link>
|
||||
|
||||
@@ -138,8 +138,8 @@ export function SidebarLayout({
|
||||
</Menu.Item>
|
||||
)) ?? [];
|
||||
|
||||
const asPathWithoutQuery = router.asPath.split('?')[0]?.split('#')[0];
|
||||
const breadcrumbs = asPathWithoutQuery?.split('/').map((path, idx, original) => (
|
||||
const asPathWithoutQueryAndAnchor = router.asPath.split('?')[0]?.split('#')[0];
|
||||
const breadcrumbs = asPathWithoutQueryAndAnchor?.split('/').map((path, idx, original) => (
|
||||
<Link key={idx} href={original.slice(0, idx + 1).join('/')} passHref>
|
||||
<Anchor component="a">{path}</Anchor>
|
||||
</Link>
|
||||
|
||||
Reference in New Issue
Block a user