nextjs - 💡(How to fix) Fix Bug: <Link href="/"> no longer scrolls to top when navigating to same route [3 comments, 4 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#88030Fetched 2026-04-08 02:05:38
View on GitHub
Comments
3
Participants
4
Timeline
6
Reactions
3
Timeline (top)
commented ×3issue_type_added ×1labeled ×1subscribed ×1

In Next.js 14, clicking a <Link href="/" /> while already on the / route correctly scrolls the page back to the top.

After upgrading to Next.js 16.1.1, this behavior no longer works. The scroll position is preserved, and the page does not move to the top.

This appears to be a regression or an undocumented change in scroll restoration behavior.


Root Cause

In Next.js 14, clicking a <Link href="/" /> while already on the / route correctly scrolls the page back to the top.

After upgrading to Next.js 16.1.1, this behavior no longer works. The scroll position is preserved, and the page does not move to the top.

This appears to be a regression or an undocumented change in scroll restoration behavior.


Fix Action

Fix / Workaround

  • This behavior worked correctly in Next.js 14 without any custom scroll handling.
  • The issue occurs when navigating to the same route (/ → /) using <Link />.
  • This is commonly needed for persistent navigation UIs such as:
    • Bottom navigation bars
    • Dock-style navigation
    • Fixed headers / footers
  • The navigation component remains mounted between navigations.
  • Setting scroll={true} on <Link /> does not restore the previous behavior.
  • Manually calling window.scrollTo(0, 0) resolves the issue but feels like a workaround.
  • No related breaking change or migration note was found in the Next.js 15/16 documentation.

Code Example

import Link from "next/link";

export default function Page() {
  return (
    <div>
      <div style={{ height: "200vh" }}>Scroll down</div>
      <Link href="/">Go Home</Link>
    </div>
  );
}

---

### Environment

- **Next.js version:** 16.1.1
- **React version:** 19.2.3
- **React DOM version:** 19.2.3
- **Router:** App Router
- **Node.js:** 20.x
- **Package manager:** pnpm
- **OS:** Windows 11
- **Browser:** Chrome

---

### `package.json`


{
  "name": "scroll-bug-repro",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "eslint"
  },
  "dependencies": {
    "next": "16.1.1",
    "react": "19.2.3",
    "react-dom": "19.2.3"
  },
  "devDependencies": {
    "@tailwindcss/postcss": "^4",
    "@types/node": "^20",
    "@types/react": "^19",
    "@types/react-dom": "^19",
    "eslint": "^9",
    "eslint-config-next": "16.1.1",
    "tailwindcss": "^4",
    "typescript": "^5"
  }
}
RAW_BUFFERClick to expand / collapse

🐛 Bug: <Link href="/" /> does not scroll to top on same-route navigation

Description

In Next.js 14, clicking a <Link href="/" /> while already on the / route correctly scrolls the page back to the top.

After upgrading to Next.js 16.1.1, this behavior no longer works. The scroll position is preserved, and the page does not move to the top.

This appears to be a regression or an undocumented change in scroll restoration behavior.


Link to the code that reproduces this issue

https://github.com/Kaushik7984/scroll-bug-repro

To Reproduce

import Link from "next/link";

export default function Page() {
  return (
    <div>
      <div style={{ height: "200vh" }}>Scroll down</div>
      <Link href="/">Go Home</Link>
    </div>
  );
}
  • Steps to reproduce:
  1. Visit /
  2. Scroll down
  3. Click the Go Home link
  4. Page does not scroll to top

Current vs. Expected behavior

Expected Behavior

Clicking a link pointing to the current route (e.g. <Link href="/" /> when already on /) should scroll the page to the top, matching the behavior in Next.js 14.


Actual Behavior

In Next.js 16.1.1:

  • Clicking <Link href="/" /> while already on /
  • Does not scroll to the top
  • Scroll position remains unchanged

Provide environment information

### Environment

- **Next.js version:** 16.1.1
- **React version:** 19.2.3
- **React DOM version:** 19.2.3
- **Router:** App Router
- **Node.js:** 20.x
- **Package manager:** pnpm
- **OS:** Windows 11
- **Browser:** Chrome

---

### `package.json`


{
  "name": "scroll-bug-repro",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "eslint"
  },
  "dependencies": {
    "next": "16.1.1",
    "react": "19.2.3",
    "react-dom": "19.2.3"
  },
  "devDependencies": {
    "@tailwindcss/postcss": "^4",
    "@types/node": "^20",
    "@types/react": "^19",
    "@types/react-dom": "^19",
    "eslint": "^9",
    "eslint-config-next": "16.1.1",
    "tailwindcss": "^4",
    "typescript": "^5"
  }
}

Which area(s) are affected? (Select all that apply)

Linking and Navigating

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

Additional Context

  • This behavior worked correctly in Next.js 14 without any custom scroll handling.
  • The issue occurs when navigating to the same route (/ → /) using <Link />.
  • This is commonly needed for persistent navigation UIs such as:
    • Bottom navigation bars
    • Dock-style navigation
    • Fixed headers / footers
  • The navigation component remains mounted between navigations.
  • Setting scroll={true} on <Link /> does not restore the previous behavior.
  • Manually calling window.scrollTo(0, 0) resolves the issue but feels like a workaround.
  • No related breaking change or migration note was found in the Next.js 15/16 documentation.

This makes it difficult to implement expected UX patterns where re-clicking the active route should reset scroll position.

extent analysis

TL;DR

Manually scrolling to the top using window.scrollTo(0, 0) when navigating to the same route may be necessary due to a potential regression in Next.js 16.1.1.

Guidance

  • Verify that the issue is indeed a regression by testing the same code in Next.js 14 and comparing the behavior.
  • Consider adding a custom onClick handler to the <Link> component that manually scrolls to the top using window.scrollTo(0, 0).
  • Check the Next.js documentation and GitHub issues for any updates or workarounds related to scroll restoration behavior in version 16.1.1.
  • If the issue persists, try setting scroll={false} on the <Link> component to see if it affects the scrolling behavior.

Example

import Link from "next/link";

export default function Page() {
  const handleClick = (e) => {
    e.preventDefault();
    window.scrollTo(0, 0);
  };

  return (
    <div>
      <div style={{ height: "200vh" }}>Scroll down</div>
      <Link href="/" onClick={handleClick}>Go Home</Link>
    </div>
  );
}

Notes

This workaround may not be ideal, but it can help restore the expected behavior until a more official solution is found. It's also worth noting that this issue may be specific to certain use cases, such as persistent navigation UIs.

Recommendation

Apply workaround: manually scrolling to the top using window.scrollTo(0, 0) when navigating to the same route, as shown in the example code. This is because the issue appears to be a regression in Next.js 16.1.1, and a custom solution is needed to restore the expected behavior.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

nextjs - 💡(How to fix) Fix Bug: <Link href="/"> no longer scrolls to top when navigating to same route [3 comments, 4 participants]