Skip to content

onBlur called twice #1547

Closed
Closed
@sizeight

Description

@sizeight

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions