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

Clicking on backdrop fills input even if i didn't select any date, but fails to fire onChange. #70

Open
ravisojitra opened this issue Nov 9, 2020 · 0 comments

Comments

@ravisojitra
Copy link

Describe the bug
When i open datepicker and if i click on backdrop without selecting any date then it fills today's date in input but it doesn't fire handleChange. Either both should be done or none(this would be the right one since i didn't select any date). It's creating problem in form validation where date is auto filled but it's value is still null|undefined.

To Reproduce
Steps to reproduce the behavior:
https://codesandbox.io/s/react-datepicker-forked-okr9d?file=/src/index.js
0. Clear date input

  1. Focus date input again
  2. Click outside without selecting any date
  3. It fills date input with current date but doesn't fire handleChange

Expected behavior
When i click outside without selecting any date, It should not fill input to today's date.

Desktop (please complete the following information):

  • OS: ubuntu
  • Browser chrome
  • Version 86.0.4240.183
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

No branches or pull requests

1 participant