Next.js Discord

Discord Forum

next/link jumps to top of page even with scroll={false} set

Unanswered
Bigheaded ant posted this in #help-forum
Open in Discord
Avatar
Bigheaded antOP
I'm using next/link to create a table of contents on my page. Each link is configured as follows:
<Link className={className} href={`#${href}`} scroll={false}>
  {children}
</Link>

However, as I click through the links in the ToC, each one causes the page to briefly jump to the top before scrolling to the element with the appropriate id. I switched to using <a> tags and it worked properly. This is on NextJS 13.4.17 with the pages directory, anybody know if this was fixed in a newer version or what could be causing it to break in this version?

1 Reply

Avatar
Bigheaded antOP
It looks like this user is having the same issue: https://github.com/vercel/next.js/discussions/46604