feat(react): improve form-control accessibility#138
Open
wangdicoder wants to merge 1 commit into
Open
Conversation
- Form.Item now generates ids that wire `aria-labelledby`, `aria-describedby`, and `aria-invalid` on the wrapped control so labels and validation errors are announced by screen readers. - Cascader forwards the consumer's ref to the wrapper and passes `id` and the `aria-*` props through to the combobox element. - InputNumber omits `min`, `max`, `aria-valuemin`, and `aria-valuemax` when the bounds are not finite (previously emitted `Infinity` / `-Infinity` strings) and forwards remaining native input props. Adds an axe-based Playwright accessibility suite under apps/docs/tests/accessibility/ covering form controls, overlays, and popups, plus a `pnpm test:accessibility` script and a CI step that installs Chrome via Playwright and runs the suite.
3 tasks
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
aria-labelledby,aria-describedby, andaria-invalidon the wrapped control so labels and validation errors are announced by screen readers.refto the wrapper (previously dropped, stored on a privatewrapperRef) and pipesidandaria-*props through to the combobox element.min/max/aria-valuemin/aria-valuemaxwhen the bounds are not finite — previously emittedInfinity/-Infinitystrings into the DOM — and forwards remaining native input props. Snapshot updated.apps/docs/tests/accessibility/covering form controls, overlays (Modal/Drawer/Tour), and popup pickers (Select/DatePicker/Cascader).pnpm test:accessibilityscript and CI step that installs Chrome via Playwright.Test plan
pnpm --filter @tiny-design/react test— 40 tests across form / input-number / cascader pass, including new a11y tests