Skip to content

WT-851 Update navigation state correctly on click#1242

Open
bluewave41 wants to merge 2 commits into
mainfrom
WT-851-fix-drop-down-click
Open

WT-851 Update navigation state correctly on click#1242
bluewave41 wants to merge 2 commits into
mainfrom
WT-851-fix-drop-down-click

Conversation

@bluewave41
Copy link
Copy Markdown
Collaborator

One-line summary

The navigation bar closes and opens the panel when clicked instead of just closing. This is because is contains a focus handler as well as a click handler which both run when clicked.

Issue / Bugzilla link

https://mozilla-hub.atlassian.net/browse/WT-851

Testing

  • Checkout this PR
  • Hover over an item in the navigation (Browser) ensuring the drop down appears
  • Move around each title ensuring the menus appear and disappear correctly
  • Tab into a menu and hit enter. The panel should appear.
  • Tab into the next panel. The previous panel should disappear
  • Tab out of the final panel (Resources). The menu should disappear
  • Shift+Tab out out of the first panel (Browser). The menu should disappear

@bluewave41 bluewave41 marked this pull request as draft April 8, 2026 19:50
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.54%. Comparing base (f605e65) to head (88ba464).
⚠️ Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1242      +/-   ##
==========================================
+ Coverage   79.25%   79.54%   +0.28%     
==========================================
  Files         135      138       +3     
  Lines        8375     8574     +199     
==========================================
+ Hits         6638     6820     +182     
- Misses       1737     1754      +17     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bluewave41 bluewave41 force-pushed the WT-851-fix-drop-down-click branch 2 times, most recently from d36908a to 9e6dd16 Compare April 8, 2026 23:04
@bluewave41 bluewave41 force-pushed the WT-851-fix-drop-down-click branch from 9e6dd16 to 88ba464 Compare April 8, 2026 23:05
@bluewave41 bluewave41 marked this pull request as ready for review April 8, 2026 23:05
@maureenlholland maureenlholland added Frontend HTML, CSS, JS... client side stuff Needs Review Awaiting code review Bug Something isn't working labels Apr 9, 2026
@bluewave41
Copy link
Copy Markdown
Collaborator Author

I'll keep the labels in mind from now on :)

@maureenlholland
Copy link
Copy Markdown
Collaborator

it's not required, I do it for myself because I find the labels easier to see at a glance than whether or not the PR's in draft

@bluewave41 bluewave41 changed the title Update navigation state correctly on click WT-851 Update navigation state correctly on click Apr 14, 2026
Copy link
Copy Markdown
Contributor

@janriokrause janriokrause left a comment

Choose a reason for hiding this comment

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

Tested and works for me, but leaving the approval to the front-end team.

💡 Idea: We could drop focusedMenu if we switch the mouse handler from click to pointerdown and add a keyboard keydown handler (Enter/Space). pointerdown fires before focus/click, so it avoids the focus -> click double‑toggle that caused the re‑open. Hover behavior stays the same.

@janriokrause janriokrause linked an issue May 16, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Frontend HTML, CSS, JS... client side stuff Needs Review Awaiting code review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Top menu dropdown behaves unexpectedly

3 participants