Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessibility improvements in fork #158

Open
alexlouden opened this issue Jul 12, 2019 · 2 comments
Open

Accessibility improvements in fork #158

alexlouden opened this issue Jul 12, 2019 · 2 comments

Comments

@alexlouden
Copy link

Hey there, I forked this library and I've made a bunch of changes including some accessibility improvements. Thought I'd share so you could pull some changes back upstream if you liked! 🙂

https://github.com/Bonobolabs/time-picker

Here I'm using arrow keys to navigate:

Demo

(There are quite a lot of changes you won't want to include, but I tried to make changes as separate commits so you may be able to cherry pick)

Full list of the accessibility changes:

  • keyboard navigation
    • press space/enter to open or select options
    • press escape to close panel
    • change time and navigate between lists with arrow keys
  • focus trap
    • focus stays within open time picker panel and doesn't get lost to background content
    • when the panel is expanded the input is focused, and focus is returned when collapsed
  • uses ul/li elements with radiogroup/radio roles - so when you select hour 3 screenreader will read "3, radio, 1 of 12, Select hour, radio group".
    • This also allows for navigating between radio groups (from "Select hour" to "Select minute") in Group mode.
    • aria-checked is used to indicate the currently selected element
  • screen-reader friendly aria-labels with no leading zeros (so screenreader says "one" instead of "zero one"), and labels on radio groups (e.g. "Select AM or PM").
  • aria-invalid is used to indicate incorrectly formatted time (when entering time manually)
@0w3w
Copy link

0w3w commented Mar 18, 2021

Hey, I'd benefit for this changes to be incorporated into this project.

I'd recommend creating a pull request for this.

@alexlouden
Copy link
Author

@0w3w I made some pretty major, quite opinionated changes so I'm not going to do a PR back to this repo, but you're welcome to use https://github.com/Bonobolabs/time-picker

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

No branches or pull requests

2 participants