Skip to content

fix: enable scroll restoration for route navigation (#1180)#1206

Merged
magic-peach merged 1 commit into
magic-peach:mainfrom
aaniya22:fix/scroll-position-route-navigation-1180
May 26, 2026
Merged

fix: enable scroll restoration for route navigation (#1180)#1206
magic-peach merged 1 commit into
magic-peach:mainfrom
aaniya22:fix/scroll-position-route-navigation-1180

Conversation

@aaniya22
Copy link
Copy Markdown
Contributor

Summary

Fixes #1180

When navigating between pages/routes, the scroll position was not being
preserved or consistently reset. This was caused by missing scroll
restoration configuration in Next.js.

Root Cause

Next.js does not enable scroll restoration by default. Without it, the
browser's native scroll restoration behavior is inconsistent across
route changes.

Fix

Enabled the scrollRestoration experimental flag in next.config.ts:

experimental: {
  scrollRestoration: true,
},

This tells Next.js to manage scroll position during client-side
navigation — restoring position on back/forward navigation and
resetting to top on fresh route loads.

Changes Made

  • next.config.ts — added experimental.scrollRestoration: true

Build

✓ Build passes with no errors or warnings related to this change.


Contributing under GSSoC'26

@vercel
Copy link
Copy Markdown

vercel Bot commented May 26, 2026

@aaniya22 is attempting to deploy a commit to the magic-peach1's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added level:beginner Beginner level - 20 pts type:bug Bug fix labels May 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

✅ PR Format Check Passed — @aaniya22

Basic format checks passed. A maintainer will review your code changes.

This does not mean the PR is approved — it just means the format is correct.

@github-actions
Copy link
Copy Markdown
Contributor

👋 Thanks for your PR, @aaniya22!

Welcome to Reframe — a browser-based video editor built for everyone 🎬

🟠 GSSoC'26 PR detected — thanks for contributing under GirlScript Summer of Code 2026!

What happens next

  1. 🤖 Automated checks — build & TypeScript typecheck will run automatically
  2. Vercel preview — a preview deployment will be created (requires maintainer authorization for fork PRs)
  3. 👀 Code review — a maintainer will review your changes
  4. 🚀 Merge — once approved, your PR will be merged!

Quick checklist

  • PR title follows Conventional Commits (e.g. feat: add dark mode)
  • Linked the issue this PR closes (e.g. Closes #123)
  • Tested the changes locally (bun run dev)
  • Build passes (bun run build)

Useful links

Happy coding! 🎉

@github-actions github-actions Bot added the gssoc'26 GirlScript Summer of Code 2026 label May 26, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented May 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
reframe Ready Ready Preview, Comment May 26, 2026 10:08am

@magic-peach magic-peach added gssoc:approved Approved for GSSoC'26 quality:clean Well-implemented, clean code labels May 26, 2026
@magic-peach magic-peach merged commit 53faee5 into magic-peach:main May 26, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved Approved for GSSoC'26 gssoc'26 GirlScript Summer of Code 2026 level:beginner Beginner level - 20 pts quality:clean Well-implemented, clean code type:bug Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Page scroll position not preserved after route navigation

2 participants