react-datepicker
react-datepicker copied to clipboard
onBlur called twice
Expected behavior
onBlur to be called once.
Actual behavior
onBlur is called twice. Once with event and second time without event.
Steps to reproduce
Setup a DatePicker with an onBlur callback. handleOnBlur will be called twice and the second time will cause an error because e is undefined.
...
handleOnBlur = (e) => {
console.log(e.target.value);
}
<DatePicker
selected={this.state.startDate}
onChange={this.handleOnChange}
onBlur={this.handleOnBlur}
/>
...
This behavior still occurs on my end:
version: "react-datepicker": "^2.0.0",
The code changes found in the commit referenced here are not reflective of what I see in lib on my local machine after pulling the package through yarn add react-datepicker. Has the fix not been released yet?