darrenjennings / vue-autosuggest

🔍 Vue autosuggest component.
https://darrenjennings.github.io/vue-autosuggest
MIT License
621 stars 91 forks source link

Get highlight class when using @keydown #145

Closed maikenmadsen1992 closed 5 years ago

maikenmadsen1992 commented 5 years ago

Firstly, thank you for the great library.

What you did: I want to use the same highlight class on keydown as used when mouse hover. The class is named: autosuggest__results-item--highlighted.

Problem description: `
<vue-autosuggest id="input" autocomplete="off" :suggestions="filteredOptions" :get-suggestion-value="getSuggestionValue" @selected="onSelected" @keyup.enter="search" ------------> @keydown="focusSearchElement" <----------------- something here :sectionConfigs="sectionConfigs" :input-props="{id:'autosuggest__input', onInputChange: this.onInputChange}" @input="onInputChange"

`

Suggested solution:

Is it possible to added with the event somehow?

darrenjennings commented 5 years ago

The autosuggest__results-item--highlighted is the class name for when you keydown and when you mouseover. Could you clarify what you are wanting?

https://github.com/darrenjennings/vue-autosuggest/blob/master/src/Autosuggest.vue#L377 https://github.com/darrenjennings/vue-autosuggest/blob/master/src/Autosuggest.vue#L514

darrenjennings commented 5 years ago

Closing due to inactivity. If you can provide more detailed steps then I can look again.