react-datepicker icon indicating copy to clipboard operation
react-datepicker copied to clipboard

onBlur called twice

Open sizeight opened this issue 8 years ago • 1 comments

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}
/>
...

sizeight avatar Nov 20 '18 09:11 sizeight

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?

makesitgo avatar Jan 17 '19 00:01 makesitgo