Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/components/ui/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,18 @@ export function Button(props: ButtonProps) {
);
}

// A jump within the page is left to the browser. next/link treats a click on
// a hash that's already in the URL as a no-op navigation, so the second
// click (or the first, on a page opened at that hash) wouldn't scroll.
if (props.href.startsWith("#")) {
return (
<a href={props.href} className={classes}>
{children}
<RightArrow />
</a>
);
}

// Default: internal link
return (
<Link href={props.href} className={classes}>
Expand Down
Loading