Skip to content

fix: resolve navbar section navigation and scroll restoration#423

Merged
viru0909-dev merged 2 commits into
viru0909-dev:mainfrom
dhiyaroopyabr:fix/navbar-section-navigation
May 19, 2026
Merged

fix: resolve navbar section navigation and scroll restoration#423
viru0909-dev merged 2 commits into
viru0909-dev:mainfrom
dhiyaroopyabr:fix/navbar-section-navigation

Conversation

@dhiyaroopyabr
Copy link
Copy Markdown
Contributor

@dhiyaroopyabr dhiyaroopyabr commented May 17, 2026

Pull Request

Description

This PR fixes inconsistent navbar section navigation and scroll restoration behavior across routes.

Previously, clicking on the Features section link from pages like About or Constitution updated the URL but did not properly navigate back and scroll to the Features section on the homepage. The Home navigation behavior while already scrolled down was also inconsistent.

Changes Made

  • Updated navbar and footer section links from #features to /#features
  • Enhanced ScrollToTop.jsx to support hash-based scrolling using location.hash
  • Added smooth scrolling behavior for section navigation
  • Added delayed scroll handling to ensure proper scrolling after route rendering and mobile menu transitions
  • Preserved normal scroll-to-top behavior for standard route navigation

Closes #349

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Desktop

  • Home → Features navigation
  • Constitution/About → Features navigation
  • Home scroll-to-top behavior

Mobile

  • Mobile drawer → Features navigation
  • Cross-route section scrolling from About/Constitution pages
  • Smooth scrolling after mobile menu close

Files Modified

  • src/ScrollToTop.jsx
  • src/components/landing/Header.jsx
  • src/components/landing/Footer.jsx

Checklist

  • My code follows the project style guidelines
  • I have tested the changes locally
  • I have tested the changes on both desktop and mobile views
  • The issue is fixed without affecting existing navigation behavior

@vercel
Copy link
Copy Markdown

vercel Bot commented May 17, 2026

@dhiyaroopyabr is attempting to deploy a commit to the CodeBlooded's projects Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 17, 2026

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

Project Deployment Actions Updated (UTC)
nyaysetu Ready Ready Preview, Comment May 17, 2026 9:54am

@viru0909-dev
Copy link
Copy Markdown
Owner

@dhiyaroopyabr Please add the output screenshot or a short screen recording.

@dhiyaroopyabr
Copy link
Copy Markdown
Contributor Author

dhiyaroopyabr commented May 17, 2026

Recording.2026-05-17.161748.mp4
20260517_15_33_01_554.mp4

Sure, please find the screen recordings attached.

@dhiyaroopyabr
Copy link
Copy Markdown
Contributor Author

Hi @viru0909-dev !

I’ve added the requested screen recording demonstrating the current behavior.
Could you please take a look when you get a chance and let me know if everything looks fine? Thanks!

Copy link
Copy Markdown
Owner

@viru0909-dev viru0909-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Work! Merging this.

@viru0909-dev viru0909-dev merged commit 7ce70c4 into viru0909-dev:main May 19, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Features Navbar Navigation Breaks After Route Change

2 participants