fix(search): stop the mobile sort dropdown overflowing the viewport #17

Merged
tudor merged 1 commits from fix/mobile-sort-select-overflow into main 2026-07-06 12:46:48 +00:00
Owner

On mobile, the results-header sort <select> could run off the right edge of the screen.

Cause

The sort select has no width constraint, so a native <select> sizes to its widest option — "Highest Reading, Writing & Maths %" (~273px). On a location (postcode) search the results-header row shows the view toggle and the sort select together (justify-content: space-between), so the select was pushed right and its edge landed ~46px past a 390px viewport (clipped off-screen).

Reproduced live at 390px: .resultsHeaderActions is 343px wide, the toggle 135px, and the sort select 273px with its right edge at 436px — well past the viewport.

Fix

Inside the existing @media (max-width: 768px) block: let the sort select flex into the remaining space with min-width: 0 (so its label truncates instead of overflowing), and give the view toggle flex-shrink: 0 so it stays intact. Desktop is untouched.

Verified live by injecting the rule: the select shrinks to 196px with its right edge at 359px — fully within the viewport.

🤖 Generated with Claude Code

On mobile, the results-header sort `<select>` could run off the right edge of the screen. ## Cause The sort select has no width constraint, so a native `<select>` sizes to its **widest option** — "Highest Reading, Writing & Maths %" (~273px). On a location (postcode) search the results-header row shows the view toggle **and** the sort select together (`justify-content: space-between`), so the select was pushed right and its edge landed ~46px past a 390px viewport (clipped off-screen). Reproduced live at 390px: `.resultsHeaderActions` is 343px wide, the toggle 135px, and the sort select 273px with its right edge at **436px** — well past the viewport. ## Fix Inside the existing `@media (max-width: 768px)` block: let the sort select flex into the remaining space with `min-width: 0` (so its label truncates instead of overflowing), and give the view toggle `flex-shrink: 0` so it stays intact. Desktop is untouched. Verified live by injecting the rule: the select shrinks to 196px with its right edge at 359px — fully within the viewport. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tudor added 1 commit 2026-07-06 12:23:56 +00:00
fix(search): stop the mobile sort dropdown overflowing the viewport
PR Checks / Frontend Typecheck + Tests (pull_request) Successful in 9m37s
PR Checks / Backend Smoke (pull_request) Successful in 5s
PR Checks / Build Backend (no push) (pull_request) Successful in 10s
PR Checks / Build Frontend (no push) (pull_request) Successful in 44s
PR Checks / Build Pipeline (no push) (pull_request) Successful in 9s
PR Checks / AI Code Review (Claude) (pull_request) Successful in 1m3s
a00cbe9161
On a location search the results header shows the view toggle and the
sort <select> side by side. The select sizes to its widest option
('Highest Reading, Writing & Maths %', ~273px), so on a phone its right
edge ran ~46px past the viewport and was clipped off-screen.

On mobile let the select flex into the remaining space with min-width:0
so its label truncates instead of overflowing, and keep the view toggle
from shrinking. Verified live at 390px: the select now sits fully within
the viewport.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

🤖 AI Code Review (Claude Code)

Small, targeted CSS fix constraining the mobile sort to flex and shrink within its flex container so it no longer overflows the viewport next to the view toggle. Verified against the surrounding CSS and the HomeView.tsx markup — the two elements are flex siblings, so the fix is correctly scoped and low-risk.

No issues found.

## 🤖 AI Code Review (Claude Code) Small, targeted CSS fix constraining the mobile sort <select> to flex and shrink within its flex container so it no longer overflows the viewport next to the view toggle. Verified against the surrounding CSS and the HomeView.tsx markup — the two elements are flex siblings, so the fix is correctly scoped and low-risk. ✅ No issues found.
tudor merged commit 1cdcd85e41 into main 2026-07-06 12:46:48 +00:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: tudor/school_compare#17