diff --git a/src/component.vue b/src/component.vue index 9d34e4a5..7b50c583 100644 --- a/src/component.vue +++ b/src/component.vue @@ -69,17 +69,19 @@
{{ getItemText(item) }} @@ -148,8 +150,6 @@ export default { focused: false, selectedItem: null, selectedItemByArrows: null, - // TODO create a prop - itemsLimit: 20, searchData: '' }), computed, diff --git a/src/eventsListeners.js b/src/eventsListeners.js index e610930d..6d8e52c8 100644 --- a/src/eventsListeners.js +++ b/src/eventsListeners.js @@ -34,6 +34,9 @@ export default { this.fireSelectEvent(this.selectedItem) } + let selectedElement = this.$refs.items[this.arrowsIndex] + if (selectedElement) selectedElement.focus() + e.preventDefault() }, onEnter () { diff --git a/src/props.js b/src/props.js index 08da7f49..49dbd3a4 100644 --- a/src/props.js +++ b/src/props.js @@ -10,6 +10,11 @@ export default { required: true, note: 'array of suggestions (data fetched from backend, etc)' }, + itemsLimit: { + type: Number, + default: 20, + note: 'items limit' + }, itemText: { type: String, default: null, // 'text',