How to prevent onChange event fire onBlur in Semantic-ui-react

1.8k Views Asked by At

I expect onChange event fire when I select an Item in Dropdown component. However, onChange event fires even if I click elsewhere. How to prevent onChange event fire onBlur?

handleDomainChange = (e, data) => {
    this.setState({
      currantDomain_id: data.value,
      currantWidget_id: "null",
    }, () => {
      this.props.dispatch(
        statsFetch(
          this.props.viewRange,
          this.state.currantDomain_id,
          this.state.currantWidget_id
        )
      );
      this.widgetsDropdownOptions();
    });
  }

const DropdownDomains = () => (
      <Dropdown
        placeholder='all domains'
        className="dropdown-title"
        value={this.state.currantDomain_id}
        selection
        options={this.domainsDropdownOptions()}
        onChange={this.handleDomainChange}
        onBlur={this.nothing}
        />
    )
1

There are 1 best solutions below

0
On

Try <Dropdown selectOnBlur={false} .../>.