utrecht
utrecht copied to clipboard
Improve keyboard navigation in calendar component
Package: @utrecht/component-library-react
Component: Calendar
Currently you can only navigate inside the calendar using the Tab key which mostly works but is a bit awkward.
- Implement arrow key navigation: left, right and up/down to jump between weeks/days
- Tabbing to a date within the active month is okay, hitting enter selects the date -> ok
- Tabbing to a date in the previous/next month and hitting enter -> activates/navigates to that month, but not on the selected date (or the first/last of that month).
Resources:
https://blog.logrocket.com/how-to-build-an-accessible-date-picker-component-in-react/ seems particularly useful as they've implemented the keyboard navigation and it's also on top of date-fns