A11y | Restore Sort focus and valid chip/category roles - #36
Merged
Conversation
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>
|
Caution Review failedAn error occurred during the review process. Please try again later. Comment |
Co-authored-by: Cursor <cursoragent@cursor.com>
…hlight Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 axearia-allowed-attr.Category cards are labeled
role="group"rather thanrole="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 onbody.Characterization tests lock the new contracts. Playwright CI asserts
document.activeElementis notbody/htmlaftersort-chip-selectedandsort-chip-placed. The placed setup always select-then-places, even if a prior run persisted a placement.Axe dropped
aria-allowed-attrandnested-interactive. Floor isaria-input-field-name2 andcolor-contrast25.The resolution-plan issue map records A1 as Closed (PR #35).
Test plan
npm test(A4/A5/A6 characterization flipped)npm run a11y:ci(flooraria-input-field-name2,color-contrast25; Sort focus check)unitandaxePR checks stay green.