fix(core): keep disabled SelectableCard focusable with aria-disabled - #6158
fix(core): keep disabled SelectableCard focusable with aria-disabled#6158Geervan wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsCheckboxInput (@astryxdesign/core) · View in Storybook
SelectableCard (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: 1 accessibility violation(s) found — 1 serious. SelectableCard - 1 issue(s)
Visual RegressionStatus: No visual change across 4 compared shot(s). Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
cixzhang
left a comment
There was a problem hiding this comment.
Keyboard users can now reach disabled cards, hear they are unavailable, and continue past them without changing selection. Two things still need fixing:
- Current
mainmoved the shared checkbox semantics intoCheckbox.a11y.*, so this branch conflicts and the fixed state now reportsunexpected-pass. Please rebase, remove the stalecard-disabledknown failure and focusability exception, and keep only component-owned callback/inert coverage inSelectableCard.test.tsx. - Please drop
form=""and its assertion. This input has noname, so it cannot submit; detaching its form owner is an unrelated behavior change.
[Reviewed by Robohands]
8aa012c to
bcb165e
Compare
|
thanks for the review, rebased onto main and applied relevant changes, let me know if i am still missing anything
|
Fixes #6156
Fixes an issue where
SelectableCardwithisDisabledrendered nativedisabledon the hidden<input type="checkbox">, removing it from the tab sequence. The component now preserves focusability witharia-disabled="true"to match its documented contract.Changes
SelectableCard.tsx:disabledwitharia-disabled="true"on the hidden<input type="checkbox">.form={isDisabled ? '' : undefined}to exclude the focusable control from form submissions.<input onChange>and suppressed Space / Enter inhandleKeyDownwhen disabled.SelectableCard.stories.tsx:SelectableCard.test.tsx:aria-disabled, focus retention, and interaction blocking.Verification
vitest run packages/core/src/SelectableCard/passed (16/16).