Skip to content

Fix navbar menus after middle-click navigation - #1141

Merged
tannerlinsley merged 1 commit into
mainfrom
agent/fix-navbar-middle-click-dismissal
Aug 12, 2026
Merged

Fix navbar menus after middle-click navigation#1141
tannerlinsley merged 1 commit into
mainfrom
agent/fix-navbar-middle-click-dismissal

Conversation

@tannerlinsley

@tannerlinsley tannerlinsley commented Aug 12, 2026

Copy link
Copy Markdown
Member

Closes #1138.

What changed

Dismiss the active desktop mega menu when an auxiliary click comes from its trigger or any nested link. The existing wrapper-level dismissal state now handles middle-click in addition to ordinary click navigation.

Root cause and impact

React's onClick does not run for middle-click. The clicked link retained focus, so the CSS :focus-within rule kept that menu visible while another hovered menu opened. Handling the bubbling auxclick once at the menu wrapper removes the stuck panel without duplicating handlers across every link.

Validation

  • pnpm test — TypeScript and type-aware lint clean; 127 tests passed, 1 environment-gated docs smoke test skipped
  • Headless Chrome at desktop width — focused Blog menu was visible; middle-click set its dismissal state and hid it after the existing transition; focusing Community opened that adjacent menu normally
  • git diff --check

Risk

Low. The handler only acts for middle-button auxiliary clicks inside desktop menu wrappers and reuses the current dismissal/reset behavior.

Summary by CodeRabbit

  • Bug Fixes
    • Desktop navigation menus now close when users middle-click a menu trigger.

@tannerlinsley tannerlinsley added the source-audit Tracked by the automated source audit label Aug 12, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 12, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
tanstack-com c4ce38f Commit Preview URL

Branch Preview URL
Aug 12 2026, 03:52 PM

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ba73d80e-c592-4bd8-bd43-f5557f13f3e7

📥 Commits

Reviewing files that changed from the base of the PR and between 9cf638b and c4ce38f.

📒 Files selected for processing (1)
  • src/components/Navbar.tsx

📝 Walkthrough

Walkthrough

The desktop navigation trigger now dismisses the menu when a middle-button auxiliary click occurs on its wrapper.

Changes

Desktop navigation dismissal

Layer / File(s) Summary
Auxiliary-click dismissal
src/components/Navbar.tsx
DesktopNavTrigger invokes onDismiss() when its wrapper receives a middle-button auxiliary click.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: abeuty

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the navbar menu fix for middle-click navigation.
Linked Issues check ✅ Passed The change dismisses the desktop menu after middle-click actions, meeting issue #1138 and preventing stuck or overlapping panels.
Out of Scope Changes check ✅ Passed The three-line change is limited to desktop navbar menu dismissal and matches the linked issue scope.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/fix-navbar-middle-click-dismissal

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tannerlinsley
tannerlinsley merged commit 797555e into main Aug 12, 2026
7 checks passed
@tannerlinsley
tannerlinsley deleted the agent/fix-navbar-middle-click-dismissal branch August 12, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

source-audit Tracked by the automated source audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Navbar dropdown panel gets stuck when opening a link in a new tab with middle-click

1 participant