Skip to content

fix: keep SearchBox icon and input on one row at ≤480px#28

Merged
JSv4 merged 1 commit into
mainfrom
fix/searchbox-mobile-layout-27
May 21, 2026
Merged

fix: keep SearchBox icon and input on one row at ≤480px#28
JSv4 merged 1 commit into
mainfrom
fix/searchbox-mobile-layout-27

Conversation

@JSv4
Copy link
Copy Markdown
Contributor

@JSv4 JSv4 commented May 21, 2026

Summary

  • Fixes SearchBox: search icon detaches onto its own row at ≤480px #27 — at viewport widths ≤480px the SearchBox icon detached onto its own row, leaving the magnifying-glass icon floating above the input.
  • Root cause: the @media (max-width: 480px) block gave .oc-search-box__input flex: 1 1 100%, forcing it onto its own flex line. With flex-wrap: wrap, the order: 0 icon was pushed onto the line above it.
  • Fix: the input now uses flex: 1 1 auto so it shares the first row with the icon; only the button keeps flex: 1 1 100% and wraps to a full-width second row.

Test plan

  • Render <SearchBox placeholder="Search…" /> at ≤480px (e.g. 390px) and confirm [icon + input] on one row, [button] full-width below.
  • Confirm desktop (>480px) layout is unchanged.
  • npm run build passes.

The mobile media query gave .oc-search-box__input flex: 1 1 100%, forcing
it onto its own flex line and pushing the order:0 icon to the line above.
The input now flexes normally (flex: 1 1 auto) so it shares the first row
with the icon, and only the button wraps to a full-width second row.

Fixes #27
@JSv4 JSv4 merged commit 67737af into main May 21, 2026
4 checks passed
@JSv4 JSv4 deleted the fix/searchbox-mobile-layout-27 branch May 21, 2026 03:10
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.

SearchBox: search icon detaches onto its own row at ≤480px

1 participant