2017-08-31 42 views
0

DropdownコンポーネントでItemを選択すると、onChangeイベントが発生することが予想されます。しかし、他の場所をクリックしてもonChangeイベントが発生します。 onChangeイベントをonBlurでブロックする方法を教えてください。Semantic-ui-reactでonChangeイベントの発生を防ぐ方法

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

お試し<Dropdown selectOnBlur={false} .../>

関連する問題