Skip to content

Commit

Permalink
fix: When the Rebalance tab is selected, the Brokers tab keeps the ap…
Browse files Browse the repository at this point in the history
…pearance of being selected as well. (#1125)

Signed-off-by: hemahg <[email protected]>
  • Loading branch information
hemahg authored Oct 23, 2024
1 parent a26c83b commit 762965a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function Header({
<PageNavigation>
<Nav aria-label="Node navigation" variant="tertiary">
<NavList>
<NavItemLink url={`/kafka/${kafkaId}/nodes`}>
<NavItemLink url={`/kafka/${kafkaId}/nodes`} exact={true}>
Overview
</NavItemLink>
{cruiseControlEnable && (
Expand Down
5 changes: 3 additions & 2 deletions ui/components/Navigation/NavItemLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ export function NavItemLink<T extends string>({
}>) {
const pathname = usePathname();
const isActive = exact
? url === pathname
: pathname.startsWith(url.toString());
? pathname === url.toString()
: pathname.startsWith(url.toString()) && pathname === url.toString();

return (
<NavItem isActive={isActive}>
<Link href={url}>{children}</Link>
Expand Down

0 comments on commit 762965a

Please sign in to comment.