-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Improve keyboard navigation for date range selection #1499
Conversation
@majapw Although not ready for review yet, I'm creating this PR as requested so that you can see the current code 😺 |
7ccde16
to
2f1eecb
Compare
2f1eecb
to
7fcce50
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay, nice test coverage! I think overall we'd prefer to use the onTab/onShiftTab callbacks in the DayPicker as the solution for this rather than add this blur handler. In addition, I think the props already exist on the DateRangePickerInput(Controller) that let you know where to put the calendar.
Oops! Need to write test! Will do so tonight :D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused about the comments about the children prop! Maybe we can talk through it tomorrow.
Other than that, it's looking great!
Hey @monokrome, would be good to get a status update on this tomorrow! I'd like to do a release for @nkinser's change and I'd love to get this in too if it's close. |
Discussed a bit with @majapw, but I want to document why we are using I spent a bit of time trying to find a way to do this with onblur/onfocus/onkeydown, but the event doesn't give us the information that we need. Tabbing out sets In order to ensure that we are staying safe, I have implemented this using the |
e9fb582
to
a68d154
Compare
e7d7b82
to
b88c380
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One major comment (about the children && children
line). Everything else looks good!
Any update on this? |
Co-Authored-By: monokrome <github@monokro.me>
This reverts commit f5d58d5.
8de268a
to
19bdce9
Compare
I'm worried that maybe this feels a bit redundant since anything in `this.state` should be "current", but it does help to solve the issue w/ naming being weird?...
afb61e3
to
39b61ee
Compare
39b61ee
to
9840906
Compare
@majapw I think this is ready for review now. All changes mentioned have been made, with the caveat that I switched the naming for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming everything has been smoke-tested thoroughly in storybook, this looks great! I just have one comment where I think this.state.nextDateOffset
was accidentally used instead of dateOffset
9fc978d
to
e137cea
Compare
These changes represent an effort to improve the navigation of the date range selection via keyboard. This is primarily modifying the position of the
DayPicker
so that it is after the currently focused input on the date ranges, and comes with a few small changes to keep reasonable usability for keyboard navigation inside of theDayPicker
.