-
-
Notifications
You must be signed in to change notification settings - Fork 299
Open
Labels
Milestone
Description
The date picker is pretty terrible for keyboard users right now. After playing around with keyboard-only navigation for a bit, I think it should probably behave something like this.
All Pickers
- tab focus the picker
- spacebar to open the picker
Date Picker
- today, the
defaultValue, or thevaluedate is currently tab focused - different dates can be selected by navigating with up, down, left, and right arrow keys
- pressing left on the first date or up on the first week will navigate to the previous month
- pressing right on the last date or down on the last week will navigate to the next month
- pressing space will select the date, but not confirm
- pressing enter will select the date and confirm/close the dialog
- tab will only allow focus on year picker toggle, month picker toggle, left/right arrow buttons, current selected date, cancel button, and ok button.
Year Picker
- current year or the
defaultValue/valueyear will be currently focused - years can be chosen by pressing up, down, left, or right (left simulates up, right simulates down)
- pressing space will select the year, but not confirm
- pressing enter will select the year and confirm/close the dialog
- tab will only allow focus on year picker toggle, month picker toggle, current active year, cancel button, and ok button.
Time Picker
- current hour or minute is focused
- can select hours/minutes by navigating with up, down, left, or right arrow keys
- can type the time with numbers. (06 -> selects 6, 6 -> selects 6, 5 - selects 5, 53 -> selects 53 (minutes), 3 (hours))
- tab will only allow focus on the clock face, the hour picker toggle, the minute picker toggle, am/pm, cancel button, and ok button.
Related: #193