Skip to content

fix(ui): unjam the mobile nav toggle - #50

Merged
CodeWithEugene merged 1 commit into
mainfrom
fix/mobile-nav-toggle-jam
Sep 27, 2026
Merged

CodeWithEugene merged 1 commit into
mainfrom
fix/mobile-nav-toggle-jam

Conversation

@CodeWithEugene

Copy link
Copy Markdown
Owner

Symptom

The hamburger menu 'jams' when toggled on phones — taps near the button misfire, and fast taps make the drawer flicker open again.

Root causes (three, compounding)

  1. Header row overflow — logo (~115px) + two 16px grid gaps + actions (theme 30 + Sign In ~61 + Sign Up ~65 + hamburger 30 + gaps) ≈ 373px of min-content on a 343px viewport (iPhone 375px class). Grid auto tracks can't shrink below min-content, so the row overflows right and the hamburger — the last item — ends up half off-screen, inside the iOS edge-swipe zone. Fix: below 767px, grid gap 16→8px and the GitHub header icon hides (it remains in the footer and the drawer keeps Contribute/Blog). New budget ≈ 323px — fits a 360px phone with room to spare; tablets and desktop are untouched.
  2. Double-tap reopen race — on close, the backdrop dropped pointer-events immediately while fading for 220ms; a quick second tap passed through to the trigger and reopened the drawer (visible flicker). Fix: standard delayed-visibility transition so the backdrop keeps absorbing taps until the fade completes.
  3. iOS scroll chaining — dragging on the dimmed backdrop scrolled the page behind it; scrolling the drawer rubber-banded the document. Fix: touch-action: none on the overlay, overscroll-behavior: contain on the panel.

Verified

Compiled CSS carries all four rule changes (visibility 0s linear .22s, touch-action:none, overscroll-behavior:contain, .header-github{display:none} + .site-header-grid{gap:8px} in the ≤767px block). lint ✓ typecheck ✓ build ✓. Touch behavior itself needs a real phone — please re-test the toggle after deploy.

Three defects combined into the 'jamming' hamburger on phones:

- The actions row (theme, sign in, sign up, menu) plus the logo and two
  16px grid gaps overflow a 360-375px viewport by ~30px, pushing the
  hamburger half off-screen into the OS edge-swipe zone. Below 767px the
  grid gaps tighten to 8px and the GitHub icon hides (still linked in the
  footer), so every control is fully on-screen again.
- Fast double-taps reopened the drawer: the backdrop released pointer
  events the instant the close started, so the second tap hit the trigger
  under it. The overlay now keeps intercepting until its fade finishes
  (delayed visibility transition).
- iOS scroll chaining: dragging the dimmed backdrop scrolled the page
  behind it, and scrolling the drawer rubber-banded the document. The
  overlay gets touch-action: none and the panel overscroll-behavior:
  contain.
@CodeWithEugene
CodeWithEugene merged commit d2e021c into main Sep 27, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview — 1c12ab69 Deployed Sep 27, 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.

1 participant