Replies: 2 comments 1 reply
-
Hey @mhwice, keyboard behavior is handled by these lines: react-day-picker/src/DayPicker.tsx Lines 239 to 260 in 5fe362f It should be straightforward to implement your suggestion, which I find more intuitive as well:
If you feel like it, give it a try and open a PR updating the |
Beta Was this translation helpful? Give feedback.
1 reply
-
👋 The new keyboard shortcuts are included in v9.8.0. Thanks @mhwice for the suggestion and your work here! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, we can jump to the next/previous month and year using some predefined keyboard shortcuts. This works well but can be somewhat unintuitive for some users. I wanted to change the default keyboard shortcuts to something I felt was more intuitive: Shift + ArrowLeft/Right for month navigation and Shift + ArrowUp/Down for year navigation.
I was able to accomplish this behavior by overriding the
onDayKeyDown
callback, implementing a customDayButton
component, and using asetTimeout
hack to focus the day in the newly rendered month. Without this hack, when navigating to a new month, no day will be focused and the action cannot be repeated.With that said, this feels like a lot of extra work and hacking in order to simply change the default keybindings.
So I have three questions:
Code that accomplishes what I want in a hacky way:
Beta Was this translation helpful? Give feedback.
All reactions