I have used react-select for drop-drown feature in my application. I want to capture whether user has pressed the "Enter" button/key. I have done something like this:
render(){
const props = {
className: 'search-combobox',
placeholder: "search something",
onChange: this._onSelectionChange.bind(this),
onSelect: this.props.onSelectedItem,
options: this.state.options(),
filterOptions: this._filterOptions.bind(this),
onInputChange: this._onInputChange.bind(this),
valueKey: 'id',
};
return(
<Select {...props}
autoFocus={true}
clearable={true}
closeOnSelect={true}
escapeClearsValue={true}
onBlurResetsInput={false} />);
}
So on _onInputChange method, I tried this._onInputChange.bind(this, event). It didn't work. How to capture event then