I am current using this package Autocomplete. The issue I am currently facing is that whenever I press enter one of the props passed into Autocomplete also runs when you press enter. I have tried adding onSubmit
and preventing the default and onkeypressed as well but none of it seems to be working. All I want is for onPlaceSelected
to not run when enter is pressed here is the code snippet.
<div className={`predictiveSearch ${!empty ? 'filled' : ''}`}>
<Autocomplete
id='autocomplete'
className="searchTerm"
componentRestrictions={restrictions}
onBlur={this._handleBlur}
onChange={this._handleChange}
onPlaceSelected={this._handlePlaceSelected}
ref={'input'}
types={types}
value={text}
/>
<span className="searchLabel">{placeholder}</span>
</div>
Any idea if this is possible?
I tried adding a onSubmit and onKeyPressed
prop but it id not make a difference. I am wondering whether it is possible to change this.