only capture enter if something was selected in completions
This commit is contained in:
parent
512c9b2ac8
commit
716719187d
2 changed files with 5 additions and 1 deletions
|
@ -162,6 +162,10 @@ export default class Autocomplete extends React.Component {
|
|||
});
|
||||
}
|
||||
|
||||
hasSelection(): bool {
|
||||
return this.countCompletions() > 0 && this.state.selectionOffset !== 0;
|
||||
}
|
||||
|
||||
countCompletions(): number {
|
||||
return this.state.completionList.length;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue