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

Switch react-datepicker for react-dates #59

Merged
merged 3 commits into from
Nov 6, 2020

Conversation

jasalisbury
Copy link

Description of change
Switch out the datepicker from react-datepicker to react-dates for accessibility reasons:

  1. It was easier to make react-dates work well with a keyboard
  2. It was easier to properly markup the react-dates component with the correct aria tags
  3. react-datepicker had some strange onBlur issues preventing the calendar from properly closing that react-dates handles properly

How to test

  1. Pull down the js-129-change-datepicker-lib branch
  2. Install dependencies
  3. Start the server
  4. Browse to localhost:3000 and login
  5. Go to the activity report and enter dates into the picker, using the keyboard as well as the mouse

Issue(s)

Checklist

  • Meets issue criteria
  • Code tested
  • Meets accessibility standards (WCAG 2.1 Levels A, AA)
  • [n/a] Documentation updated

Switch out the datepicker, now using react-dates for accessibility
reasons:

 1. It was easier to make react-dates work well with a
keyboard then datepicker
 2. It was easier to properly markup the react-dates datepicker with
the correct aria tags
 3. react-datepicker had some strange onBlur issues preventing the
calendar from properly closing that react-dates handles properly
Copy link
Collaborator

@kryswisnaskas kryswisnaskas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! 👍

Works. There were only minor quirks I noticed. One was that certain dates become disabled, but I can't reproduce this behavior now. Also noticed that rapid switching between home and end as well as pg up/down sometimes jumped on the page.
Nice that the help is included with the picker. 👍

@jasalisbury
Copy link
Author

One was that certain dates become disabled.

Seems like it isn't communicated properly but if you select a start date the dates on the end date before that date are disabled (so you can't have a start date of 1/1/2020 and end date of 1/1/2019). It works similar when selecting an end date (you cannot select a start date after end date)

Also noticed that rapid switching between home and end as well as pg up/down sometimes jumped on the page.

I'll see if there is anything I can do about that

@jasalisbury
Copy link
Author

Also noticed that rapid switching between home and end as well as pg up/down sometimes jumped on the page.

I'll see if there is anything I can do about that

react-dates/react-dates#2055

@jasalisbury jasalisbury merged commit eafcba2 into main Nov 6, 2020
@jasalisbury jasalisbury deleted the js-129-change-datepicker-lib branch November 6, 2020 17:57
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

Successfully merging this pull request may close these issues.

None yet

2 participants