fixed selected event emition

This commit is contained in:
Axolotle 2020-08-02 15:30:51 +02:00
parent 9072f9cccb
commit 013485b4b0

View file

@ -89,7 +89,8 @@ export default {
this.focusedIndex-- this.focusedIndex--
} }
} else if (key === 'Enter') { } else if (key === 'Enter') {
this.onSelect(this.focusedIndex) this.onSelect(this.filteredChoices[this.focusedIndex])
this.focusedIndex = 0
} else { } else {
this.focusedIndex = 0 this.focusedIndex = 0
} }
@ -108,7 +109,6 @@ export default {
onSelect (item) { onSelect (item) {
this.$emit('selected', { item, index: this.choices.indexOf(item) }) this.$emit('selected', { item, index: this.choices.indexOf(item) })
this.focusedIndex = 0
} }
}, },