Skip to content

onChange and onBlur both trigger the onChange event #242

@tboulis

Description

@tboulis

I have a handler for the onChange event and a handler for the onBlur event. Whe the input loses focus it triggers both handlers instead of triggering only the onBlur handler:

       <InputNumber
          disabled={this.state.disabled)}
          onBlur={(e) => e.preventDefault()}
          onChange={this.handleDurationChange}
          onClick={e => e.stopPropagation()}
          precision={2}
          min={0}
          step={'0.1'}
          value={this.state.duration ? (this.state.duration / 3600).toFixed(2) : null}
        />

I've tried e.stopPropagation in the onBlur handler but nothing.
Any idea why this is happening?
Thanks in advance!

Versions:

  • react@16.12.0
  • rc-input-number@4.5.6

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