Skip to content

feat(react): improve form-control accessibility#138

Open
wangdicoder wants to merge 1 commit into
masterfrom
feat/accessibility-improvements
Open

feat(react): improve form-control accessibility#138
wangdicoder wants to merge 1 commit into
masterfrom
feat/accessibility-improvements

Conversation

@wangdicoder
Copy link
Copy Markdown
Owner

Summary

  • Form.Item: 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 (previously dropped, stored on a private wrapperRef) and pipes id and aria-* props through to the combobox element.
  • InputNumber: omits min / max / aria-valuemin / aria-valuemax when the bounds are not finite — previously emitted Infinity / -Infinity strings into the DOM — and forwards remaining native input props. Snapshot updated.
  • New axe-based Playwright accessibility suite under apps/docs/tests/accessibility/ covering form controls, overlays (Modal/Drawer/Tour), and popup pickers (Select/DatePicker/Cascader).
  • New pnpm test:accessibility script 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
  • CI: accessibility suite passes on PR run
  • Verify the new Cascader ref forwarding doesn't break consumers that already passed a ref (smoke-check the docs page)

- 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant