Close nav dropdowns on an outside click - #190
Merged
Merged
Conversation
Native <details> only closes on a second click on its own <summary> (or when a sibling in the same name= group opens) -- it stays open if you click anywhere else on the page, which reads as broken for a nav dropdown. A single delegated click listener closes any open .topbar-inner > nav details whose subtree doesn't contain the click target, so clicks on the dropdown's own contents (its links) are left alone. Verified in-browser: opens on summary click, closes on an outside click, stays open when clicking a link inside it (so navigation isn't interrupted). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hf6j2xXQXywHVh3HAVRxB3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
<details>/<summary>) only closed on a second click on their own summary. Clicking anywhere else on the page left them open.base.htmlthat closes any open.topbar-inner > nav detailswhose subtree doesn't contain the click target -- clicks on the dropdown's own links are left alone so navigation still works normally.Test plan
docker compose run --rm tests-- all 152 tests pass (JS-only change, no test coverage expected to be affected).Also serves as the first real end-to-end test of the new
cloudbuild.yaml-based deploy pipeline (#189) -- merging this should trigger a build sourced entirely from the tracked config file for the first time.Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
https://claude.ai/code/session_01Hf6j2xXQXywHVh3HAVRxB3