Fix a11y issues in input component#641
Open
fateeand wants to merge 22 commits into
Open
Conversation
Coverage report for library
Test suite run success951 tests passing in 32 suites. Report generated by 🧪jest coverage report action from 5c65b7d |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves accessibility across the UI kit’s input-related controls, primarily by enhancing cps-input semantics (labeling, ARIA attributes, keyboard operability, and focus styling) and updating component usages/tests to comply with the new requirements.
Changes:
- Added explicit
ariaLabelsupport (and related enforcement) forcps-input/cps-datepicker, and propagated aria labels into consuming templates (tables, filters, composition demos). - Improved
cps-inputaccessibility behavior: unique input id, label association,aria-invalid/required/busy, accessible clear + password-toggle interactions, and focus-ring styling. - Expanded unit + Playwright axe coverage for the input component page.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| projects/cps-ui-kit/src/lib/components/cps-tree-table/cps-tree-table.component.html | Adds aria label for global filter input. |
| projects/cps-ui-kit/src/lib/components/cps-table/cps-table.component.html | Adds aria label for global filter input. |
| projects/cps-ui-kit/src/lib/components/cps-table/components/internal/table-column-filter-constraint/table-column-filter-constraint.component.html | Adds aria labels for text/number/date filter inputs. |
| projects/cps-ui-kit/src/lib/components/cps-select/cps-select.component.html | Adds aria-busy while loading. |
| projects/cps-ui-kit/src/lib/components/cps-scheduler/cps-scheduler.component.html | Replaces empty visual label with ariaLabel. |
| projects/cps-ui-kit/src/lib/components/cps-input/cps-input.component.ts | Adds aria labeling props, required detection, keyboard focus tracking, id generation, and updated enter/clear behavior. |
| projects/cps-ui-kit/src/lib/components/cps-input/cps-input.component.html | Adds for/id association, ARIA attrs, accessible icon/button interactions, and error live-region markup. |
| projects/cps-ui-kit/src/lib/components/cps-input/cps-input.component.scss | Updates layout + focus styling to support new structure and keyboard focus indication. |
| projects/cps-ui-kit/src/lib/components/cps-input/cps-input.component.spec.ts | Updates existing tests and adds accessibility-focused unit tests. |
| projects/cps-ui-kit/src/lib/components/cps-datepicker/cps-datepicker.component.ts | Adds ariaLabel + validation warning on missing labeling. |
| projects/cps-ui-kit/src/lib/components/cps-datepicker/cps-datepicker.component.html | Passes ariaLabel and adds prefix icon aria label. |
| projects/cps-ui-kit/src/lib/components/cps-datepicker/cps-datepicker.component.scss | Aligns focus styling with new cps-input wrapper border behavior. |
| projects/cps-ui-kit/src/lib/components/cps-autocomplete/cps-autocomplete.component.html | Adds aria-busy while loading/validating. |
| projects/composition/src/app/pages/input-page/input-page.component.ts | Adds example handling for clickable prefix icon (notification). |
| projects/composition/src/app/pages/input-page/input-page.component.html | Updates width units; demonstrates clickable prefix icon + aria label. |
| projects/composition/src/app/pages/input-page/input-page.component.scss | Converts spacing from px to rem. |
| projects/composition/src/app/pages/icons-page/icons-page/icons-page.component.html | Adds aria label to search input. |
| projects/composition/src/app/pages/colors-page/colors-page/colors-page.component.html | Adds aria label to search input. |
| projects/composition/src/app/components/navigation-sidebar/navigation-sidebar.component.html | Adds aria label to sidebar search input. |
| projects/composition/src/app/api-data/cps-input.json | Documents new ariaLabel / prefixIconAriaLabel props and default icon size change. |
| projects/composition/src/app/api-data/cps-datepicker.json | Documents new ariaLabel prop. |
| playwright/cps-accessibility.spec.ts | Re-enables input page axe scan with scoped selector. |
Playwright test resultsDetails
|
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.
Fixing accessibility issues in input component
Validation rules:
Validated using Playwright accessibility tests, Lighthouse tool, and manual checks including keyboard tab navigation and screen reader testing.
Full doc with rules
Playwright axe-core validation results:
State before:
State after:
Checklist
Keyboard Navigation
All interactive elements are fully operable via keyboard only, including buttons, inputs, menus, dialogs, sliders, drag-and-drop, tree views, multi-selects, and composite widgets. No traps or dead ends.
Focus Management
Focus is visible, logical, moves in predictable order, trapped where necessary (modals/popovers), and restored after closing. Focus is perceivable in all interactive widgets.
Semantics / ARIA
Color / Contrast
Screen Reader / Assistive Technology
Responsive & Zoom
Error Handling
Dynamic Content / Updates
Interaction Feedback / States
Authentication & Sensitive Actions
Predictable & Controllable UI
Release notes: