ionic-framework
ionic-framework copied to clipboard
fix(datetime): date and time picker accessibility
Pull request checklist
Please check if your PR fulfills the following requirements:
- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been reviewed and added / updated if needed (for bug fixes / features)
- Some docs updates need to be made in the
ionic-docsrepo, in a separate PR. See the contributing guide for details.
- Some docs updates need to be made in the
- [x] Build (
npm run build) was run locally and any changes were pushed - [x] Lint (
npm run lint) has passed locally and any fixes were made for failures
Pull request type
Please check the type of change your PR introduces:
- [x] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] Other (please describe):
What is the current behavior?
Picker Internal:
- The input mode applies to all columns, regardless of which is active. e.g. When the time picker is opened, typing "24" will activate minute "24", even though the hour column is the focused column.
Datetime has several accessibility issues:
- The icon in the month/year dropdown is announced to screen readers
- Previous, current and next calendar months are announced to screen readers (e.g. non-visible months are read)
- Users cannot navigate focus easily from the calendar body to the time picker
- Time picker does not announce value changes to screen readers
- Time picker does not announce total available options in each column
- Time picker does not announce the type of column being focused
Issue URL: Internal
What is the new behavior?
Picker Internal
- The input mode behavior only applies to the focused column. e.g.: When the time picker is opened, typing "24" will not activate minute 24. Since the hour column is the focused column, first "2" will be focused and then hour "4" will be focused, since the hour column does not have an item for "24".
Accessibility
- The icon in the month/year dropdown is not announced to screen readers
- Only the active month is announced to screen readers
- Users can easily navigate from the calendar body to the time picker
- Time picker announces value changes to screen readers
- Time picker announces the total number of items available in each column
- ~~Time picker announces the type of column being focused (e.g. "5 o'clock" or "10 minutes")~~
Does this introduce a breaking change?
- [ ] Yes
- [x] No
Other information
Date picker
| Before | After |
|---|---|