Back to hub · Companion note: Sortable tables (v2) checklist
Keyboard: Tab to a column header button, then Enter / Space to sort.

Sortable tables (v2): announce sort changes + keep focus

Sorting is a state change. The “AFTER” version uses header buttons + aria-sort, keeps focus on the control you used, and announces the new order politely. It also uses a stable tie-breaker so equal values don’t reshuffle.

BEFORE (broken)
Mouse-only + focus loss
Status: Unsorted.
Before: headers look clickable, but aren’t buttons and have no aria-sort.
Name Score Time (ms)

Problems: you can’t reach the “controls” with Tab, and this demo intentionally rebuilds the header on each sort, causing focus loss.

AFTER (fixed)
Keyboard + aria-sort + stable ties
Unsorted.
After: header buttons + aria-sort + polite status. Focus stays on the header button.

Tip: sort cycles ascending → descending → none. The active column exposes state via aria-sort.

Share this demo

No tracking. If YouTube playback is blocked, this Channel Hub mirror is the primary way to view + share.