kolkov / ngx-dadata

Angular 6+ and 13+ DaData suggestion (подсказки) service implementation
MIT License
12 stars 14 forks source link

onEnter method produce unhandled errors #19

Open ghost opened 4 years ago

ghost commented 4 years ago

When user hits Enter without selecting a value from suggestions, an error occurs. It should be either handled or validation should be added:

onEnter() {
    if (this.currentFocus !== -1) {
        this.selectedSuggestion = this.data[this.currentFocus];
        this.inputValue.nativeElement.value = this.selectedSuggestion.value;
        ...
    }
}