only pass keyboard to autocomplete when it has selections

otherwise if tab is pressed, try to tab complete the last word
This commit is contained in:
Bruno Windels 2019-09-02 11:25:29 +02:00
parent 4779880a94
commit a4376a76f0
2 changed files with 6 additions and 1 deletions

View file

@ -41,6 +41,11 @@ export default class AutocompleteWrapperModel {
return this._getAutocompleterComponent().hasSelection();
}
hasCompletions() {
const ac = this._getAutocompleterComponent();
return ac && ac.countCompletions() > 0;
}
onEnter() {
this._updateCallback({close: true});
}