diff --git a/package.json b/package.json index 624d58e..773b470 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-dadata", - "version": "1.4.6", + "version": "1.4.7", "description": "Vue component for hinting addresses using dadata.ru", "main": "dist/vuedadatacomponent.umd.js", "module": "dist/vuedadatacomponent.esm.js", diff --git a/src/components/VueDadata.vue b/src/components/VueDadata.vue index 1cd6dd5..b1e8ccb 100644 --- a/src/components/VueDadata.vue +++ b/src/components/VueDadata.vue @@ -168,16 +168,13 @@ export default class VueDadata extends Vue { } else if (event.which === ENTER) { event.preventDefault(); if (this.suggestionIndex >= 0) { - this.selectSuggestion(this.suggestionIndex); + await this.selectSuggestion(this.suggestionIndex); } } } public async onSuggestionClick(index: number) { - if (this.suggestions.length >= index - 1) { - this.inputQuery = this.suggestions[index].value; - this.suggestions = await this.fetchSuggestions(); - } + await this.selectSuggestion(index); } private async fetchSuggestions(): Promise {