Sort options available via accessible select or listbox
Why it matters
A sort control built from unsemantic divs or buttons fails WCAG 2.2 SC 4.1.2 (Name, Role, Value) and SC 2.1.1 (Keyboard) — keyboard users cannot tab to the control, screen readers cannot identify it as an interactive dropdown, and arrow-key navigation expected of a listbox never fires. Sorting is a primary navigation mechanism in any results page; locking it behind mouse-only interaction excludes a non-trivial portion of users and makes the directory non-compliant in any context where WCAG conformance is required (government contracts, enterprise procurement, ADA-adjacent legal exposure).
Severity rationale
Low because the failure blocks keyboard and screen reader access to sorting without exposing data or creating a security risk.
Remediation
Use a native <select> element for the sort control — it ships with full keyboard navigation, screen reader support, and no ARIA configuration required. In components/SortControl.tsx:
<label htmlFor="sort-select">Sort by</label>
<select
id="sort-select"
value={currentSort}
onChange={e => onChange(e.target.value)}
>
<option value="relevance">Relevance</option>
<option value="rating">Highest rating</option>
<option value="distance">Nearest distance</option>
</select>
If a custom styled dropdown is required for design reasons, use Radix UI's <Select> or shadcn/ui's Select component — both implement the ARIA listbox pattern with correct keyboard navigation. Do not build a custom dropdown from <div> or <button> elements without the full ARIA combobox/listbox implementation.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Search & Discovery UX Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- wcag:2.2 · 4.1.2 — Name, Role, Value
- wcag:2.2 · 2.1.1 — Keyboard
Taxons
History
- 2026-04-18·v1.0.0·Initial import from directory-search-discovery·automated