Commit 6740ba8
fix: improve navbar search dropdown behavior (google#4891)
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.1 parent 5886742 commit 6740ba8
4 files changed
Lines changed: 238 additions & 169 deletions
Submodule googleapis updated 3159 files
0 commit comments