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

Improve focus/blur events and add handlers for determining state of calendar #1814

Draft
wants to merge 6 commits into
base: master
from

Conversation

@matkrzy
Copy link
Contributor

commented Jul 5, 2019

Please review this PR - this is draft until our QA doesn't accept the changes
In the current project, we faced a few issues and here is what I changed.

1. Fix blur on select and fix focus issue on IE
2. Replaced preventFocus from timeouts to flag in component

ezgif-3-64b769451847

What I did

  • Removed blur event on setOpen - when a user selects the date the focus should be still on the input
  • Replaced preventFocus timeout to flag because of the timeouts causes an unexpected open of the calendar like on the image. After that change everything is ok, and the calendar behaves properly.

3. New handlers for determining the state of the calendar - Fixes #1797

What I did
When the calendar is opened the onCalendarOpen is triggered and when the calendar is closed the onCalendarClose is triggered

4. Fixed custom header example
#1735 and #1691

5. Revert class name for day in calendar
After migration from moment to date-fns we loose information about what day is under the element from day class name.
Before change:
react-datepicker__day react-datepicker__day--005 react-datepicker__day--selected react-datepicker__day--today
After change
react-datepicker__day react-datepicker__day--fir react-datepicker__day--selected react-datepicker__day--today

6. onInputError returns new messages

{
  dateInvalid: { code: 1, msg: "Date input not valid" },
  dateOutOfBounds: { code: 2, msg: "Date is out of bounds" }
}
@matkrzy matkrzy changed the title Bugfix/ie blur focus issue Improve focus/blur events and add handlers for determining state of calendar Jul 5, 2019
@matkrzy matkrzy force-pushed the matkrzy:bugfix/ie-blur-focus-issue branch from 665145f to 8b562c9 Jul 5, 2019
@matkrzy matkrzy force-pushed the matkrzy:bugfix/ie-blur-focus-issue branch 3 times, most recently from 5e91822 to b3de0b6 Oct 3, 2019
@matkrzy matkrzy force-pushed the matkrzy:bugfix/ie-blur-focus-issue branch from b3de0b6 to 817ff4e Oct 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.