Repository navigation
Conversation
The header (role="button" or "tab") only toggled on Enter (WCAG 2.2 SC 2.1.1). Space now toggles it without scrolling the page. Key events from nested controls, such as a button in `extra`, are left to those controls. Based on react-component#457. ref ant-design/ant-design#59684 Co-authored-by: Ferit Cem <92086876+feritcemkahraman@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Someone is attempting to deploy a commit to the React Component Team on Vercel. A member of the Team first needs to authorize it. |
|
Caution Review failedThe pull request is closed. Finishing Touches
Warning Some tools did not complete. Review the errors below.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #459 +/- ##
==========================================
+ Coverage 99.20% 99.23% +0.03%
==========================================
Files 5 5
Lines 126 131 +5
Branches 46 48 +2
==========================================
+ Hits 125 130 +5
Misses 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Related issue
Fixes ant-design/ant-design#59684 (Space key part;
aria-controlswas added in #458).Takes over #457, which has been conflicting with
masterand failing Codecov for several days. The original author is credited as co-author of the commit. Thanks @feritcemkahraman!Problem
The panel header has
role="button"(orrole="tab"in accordion mode), but it only toggles on Enter. A button must also respond to Space (WCAG 2.2 SC 2.1.1 Keyboard).Solution
Panel: Space toggles the panel, like Enter.preventDefault()keeps the page from scrolling, like a native button.<button>inextra) are ignored by the header, so Space and Enter keep their own action on those controls.e.key === ' 'is checked: React already normalizeskey, so the legacy'Spacebar'/whichfallbacks from fix: support Space key to toggle panel and prevent default scroll #457 are not needed (they were the uncovered lines in Codecov).Tests
should toggle panel when press space: Space toggles the panel, the default action is prevented, and a disabled header ignores it.should leave keyboard events on a nested extra button to the button: Space and Enter on a nested button do not toggle the panel.npm test(102 passed),npm run lintandnpm run tscpass.