Skip to content

fix: improve navbar search dropdown behavior#4891

Merged
another-rex merged 6 commits into
google:masterfrom
ashmod:fix/navbar-search-dropdown
Mar 23, 2026
Merged

fix: improve navbar search dropdown behavior#4891
another-rex merged 6 commits into
google:masterfrom
ashmod:fix/navbar-search-dropdown

Conversation

@ashmod

@ashmod ashmod commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

The previous navbar search had the dropdown appended as a detached element, making it visually fragile.
For example, zooming in while the search dropdown is on would often break it because of it not being properly attached to the search field:

image

Additionally, the styles applied on dropdown made it feel somewhat disconnected (e.g. radius would change on dropdown and the dropdown wouldn't feel seamless with the search field), this stood out particularly in light mode.

This PR refactors the dropdown to mount inline as a child of the search form, to flow naturally below the input.

Before/After:

dropdown_before-after.mp4

This PR also fixes a few related issues: event listeners that were never cleaned up, the search bar open animation very briefly flashing the submit arrow (see Before at 0.25x) and applied some cleanup to the search module.

@jess-lowe jess-lowe self-requested a review February 26, 2026 03:11
@ashmod ashmod changed the title fix(search): smooth out navbar dropdown behavior fix: improve navbar search dropdown behavior Mar 3, 2026
@jess-lowe

Copy link
Copy Markdown
Contributor

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request provides a solid refactoring of the navbar search dropdown, improving its behavior and visual stability by mounting it inline. The JavaScript has been significantly cleaned up, fixing event listener leaks and improving code organization. The SCSS changes are also well-structured, using variables and better nesting. I have one minor suggestion regarding a potential visual regression in the search suggestions on the list page. Overall, this is a great improvement.

Comment thread gcp/website/frontend3/src/styles.scss

@jess-lowe jess-lowe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks!

@another-rex another-rex merged commit 23c9948 into google:master Mar 23, 2026
21 checks passed
tymzd pushed a commit to tymzd/osv.dev that referenced this pull request Apr 13, 2026
The previous navbar search had the dropdown appended as a detached
element, making it visually fragile.
For example, zooming in while the search dropdown is on would often
break it because of it not being properly attached to the search field:

<div align="center">
<img width="1907" height="158" alt="image"
src="https://github.com/user-attachments/assets/c0cb86ec-8eff-4bbd-856d-2d4a8aabe6c1"
/>
</div>

Additionally, the styles applied on dropdown made it feel somewhat
disconnected (e.g. radius would change on dropdown and the dropdown
wouldn't feel seamless with the search field), this stood out
particularly in light mode.

This PR refactors the dropdown to mount inline as a child of the search
form, to flow naturally below the input.

Before/After:

https://github.com/user-attachments/assets/239896b2-0c20-4cd3-9a35-61148d3f18e7

This PR also fixes a few related issues: event listeners that were never
cleaned up, the search bar open animation very briefly flashing the
submit arrow (see Before at 0.25x) and applied some cleanup to the
search module.
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.

3 participants