Skip to content

fix(nav): soft-nav cross-route mobile drawer links instead of a full reload #272

Description

@yigitdot

Summary

The mobile drawer still forces a full page reload when one of its section links is tapped from another route (e.g. /blog/*, /legal/*). MobileMenu.tsx:177 calls window.location.assign(isHome ? "/" : /#${anchor}) in the drawer's close cleanup.

That reload was a workaround for the Next 16 App Router hash-appending bug (#116). Next 16.3.8 fixes that bug, and #270 already removes the matching workaround from the desktop nav (Chrome.tsx). The drawer should behave the same way, so it doesn't do a full page reload when the site can navigate without one.

Evidence (from #270)

The test drove headless Chrome against the static export:

  • router.push('/#method') after a reload gives /#method#method on Next 16.2.6 and a clean /#method on 16.3.8.
  • Going to a section from another page with router.push('/#id') lands on the same URL and the same scroll position as location.assign.

Proposed change

  • In the drawer's close cleanup, replace window.location.assign(...) with router.push(...) from next/navigation. Keep it after the body unlock, so the pinned position: fixed body is released before the navigation.
  • Update the comment that calls the soft-nav path unreliable.

Acceptance

  • From /blog/, a blog post and /legal/privacy/ at mobile width, tapping each drawer section navigates without a reload, lands on the section with a single clean hash, and leaves the body unpinned.
  • Tapping home from another route lands on / with no hash.
  • Same-page drawer taps are unchanged.

Depends on #270 (the Next 16.3.8 bump).

Activity

  1. added a commit that references this issue on Oct 9, 2026
    adfca60
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions