Open carpben opened 6 years ago
It seems I can't pass the component an onKeyPress property, to handle an enter press case.
Hi, you can easily achieve this by using inputProps:
inputProps={{onKeyPress: (e)=>{
if (e.key === 'Enter') {
// do whatever
}
}}}
I am looking for an autocomplete that can suggest options from a given list, but can also accept other options. However when I the AutoComplete component this property:
onSelect={val => console.log(`selection val=${val}`)}
And then in the browser I type into it and press enter, it will only call the function when there is a highlighted suggestion, and call it with the highlighted suggestion as an argument. Is there a way to use any term and with enter send that value?