Skip to content

A11y | Restore Sort focus and valid chip/category roles - #36

Merged
BrianGenisio merged 4 commits into
mainfrom
fix/a11y-sort-widget
Aug 17, 2026
Merged

A11y | Restore Sort focus and valid chip/category roles#36
BrianGenisio merged 4 commits into
mainfrom
fix/a11y-sort-widget

Conversation

@BrianGenisio

Copy link
Copy Markdown
Contributor

Summary

Sort now keeps keyboard focus across render(), and its tray/category markup is valid ARIA (audits A4, A5, A6).

Closes #23, closes #24, closes #25.

Changes

Tray chips stay <button aria-pressed>. role="listitem" moves to a wrapper, which clears axe aria-allowed-attr.

Category cards are labeled role="group" rather than role="button" wrapping placed chip buttons. The heading is a real button and is the Enter/Space placement control. Click-to-place on the card (except chips) and drag-and-drop are unchanged.

render() captures the focused chip (data-item-index) or category head and restores it after the rebuild, so focus does not land on body.

Characterization tests lock the new contracts. Playwright CI asserts document.activeElement is not body/html after sort-chip-selected and sort-chip-placed. The placed setup always select-then-places, even if a prior run persisted a placement.

Axe dropped aria-allowed-attr and nested-interactive. Floor is aria-input-field-name 2 and color-contrast 25.

The resolution-plan issue map records A1 as Closed (PR #35).

Test plan

  • npm test (A4/A5/A6 characterization flipped)
  • npm run a11y:ci (floor aria-input-field-name 2, color-contrast 25; Sort focus check)
  • Keyboard: select a tray chip, Tab to a category heading, Enter to place. Focus should stay on the chip or heading, not jump to the top of the page.
  • Mouse click-to-place (card, not chip) and drag-and-drop still work.
  • Confirm unit and axe PR checks stay green.

Tray listitem wraps the chip button. Category cards are labeled groups
with a heading button for keyboard placement.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Caution

Review failed

An error occurred during the review process. Please try again later.


Comment @coderabbitai help to get the list of available commands.

Brian Genisio and others added 3 commits August 17, 2026 10:56
Co-authored-by: Cursor <cursoragent@cursor.com>
…hlight

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@BrianGenisio
BrianGenisio merged commit e68fd0f into main Aug 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant