Skip to content

fix(ui) : keep mobile navigation menu sticky while scrolling - #9344

Closed
TheCoderGeekSquadLeader wants to merge 3 commits into
nodejs:mainfrom
TheCoderGeekSquadLeader:fix/sticky-mobile-menu
Closed

TheCoderGeekSquadLeader wants to merge 3 commits into
nodejs:mainfrom
TheCoderGeekSquadLeader:fix/sticky-mobile-menu

Conversation

@TheCoderGeekSquadLeader

Copy link
Copy Markdown

Description

On mobile viewports, opening the navigation menu and scrolling down a long page causes the header and open menu to scroll out of view, forcing users to scroll back to the top to navigate or close the menu.

This PR updates the mobile navigation behavior so it remains accessible while scrolling:

  • Kept the mobile navigation sticky at the top of the viewport when open.
  • Constrained the open menu height on smaller viewports and enabled internal scrolling for longer link lists.
  • Preserved existing desktop navigation behavior.
  • Added Playwright test coverage for scrolling while the mobile menu is open.

Validation

  1. Open the site on a mobile viewport (e.g., 390px width) and open the hamburger menu.
  2. Scroll down a long page (such as the homepage or a documentation page).
  3. Verify that the menu stays pinned at the top of the viewport, internal menu scrolling works smoothly on smaller screens, and desktop navigation remains unaffected.

Related Issues

Fixes #<ISSUE_NUMBER>

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run pnpm format to ensure the code follows the style guide.
  • I have run pnpm test to check if all tests are passing.
  • I have run pnpm build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

Signed-off-by: TheCoderGeekSquadLeader <lepluscultive@gmail.com>
@TheCoderGeekSquadLeader
TheCoderGeekSquadLeader requested a review from a team as a code owner November 22, 2026 16:18
@vercel

vercel Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
nodejs-org Ready Ready Preview Nov 23, 2026 11:15am UTC

Request Review

@AugustinMauroy AugustinMauroy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

okay it's work. but I pretty sure we can achieve this by only using css instead of strange js to modify style

@TheCoderGeekSquadLeader

Copy link
Copy Markdown
Author

okay it's work. but I pretty sure we can achieve this by only using css instead of strange js to modify style

Thanks for the review and the feedback ! Noted, I'll remove the JS style manipulation and handle this purely with CSS, then push an update.

Signed-off-by: TheCoderGeekSquadLeader <lepluscultive@gmail.com>

@ovflowd ovflowd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What's the need of this? Why do we need sticky headers on mobile? This will cause the header to use much of the already very limited Viewport we have on mobile.

Sorry, I'm -1 with this change 😅

@codecov

codecov Bot commented Nov 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.09%. Comparing base (f05429d) to head (5086051).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9344      +/-   ##
==========================================
- Coverage   87.12%   87.09%   -0.04%     
==========================================
  Files          92       92              
  Lines        6656     6656              
  Branches      405      405              
==========================================
- Hits         5799     5797       -2     
- Misses        853      855       +2     
  Partials        4        4              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@github-actions

Copy link
Copy Markdown
Contributor

📦 Build Size Comparison

Summary

Metric Value
Old Total First Load JS 7.22 MB
New Total First Load JS 7.22 MB
Delta 20.00 B (0.00%)

Changes

🔄 Modified Routes (4)
Route Old First Load JS New First Load JS Delta
/[locale] 1.69 MB 1.69 MB 📈 5.00 B (0.00%)
/[locale]/[...path] 1.69 MB 1.69 MB 📈 5.00 B (0.00%)
/[locale]/blog/[...path] 1.69 MB 1.69 MB 📈 5.00 B (0.00%)
/[locale]/download/archive/[version] 1.69 MB 1.69 MB 📈 5.00 B (0.00%)

This branch was successfully deployed

2 active deployments
Storybook — 50860515 Deployed Nov 23, 2026 by TheCoderGeekSquadLeader via Chromatic #2502
Preview — 50860515 Deployed Nov 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants