Open turpana opened 5 years ago
I added a test on my fork which fails, but passes if you uncomment the input.simulate('blur')
line:
https://github.com/turpana/react-input-calendar/blob/master/src/tests/index.js#L60
The blur event must be the difference between just pressing Enter
or interacting further with the form. Hopefully that makes it a little clearer what the cause of the issue is.
When manually typing in the date into the input field and immediately pressing on the
Enter
key to submit the form, an incorrect date is passed to theonChange
handler. This does not happen if I click on the submit button or continue editing the form before submitting.