darrenjennings / vue-autosuggest

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

Using arrow keys to navigate down and up again lets you select negative / non-existant entries #190

Closed account-suspended closed 4 years ago

account-suspended commented 4 years ago

What you did: 1) Go to any implementation, for example: https://darrenjennings.github.io/vue-autosuggest 2) Type a letter so you get the suggestions 3) Use the down arrow key to select a suggestion 4) Use the up arrow key to go back to the input and keep pressing up a couple of times 5) To get back to the suggestions, you'd expect that the down arrow key would work immediately, but you have to press it as often as you pressed the up arrow key in step 4

Tried it in current versions of Chrome, Firefox, Safari on current macos and Windows.

Suggested solution: Probably make sure the index variable can't be negative

darrenjennings commented 4 years ago

seems like a regression, thanks for noticing. Will coerce the index to not exceed negative -1

darrenjennings commented 4 years ago

Released in https://github.com/darrenjennings/vue-autosuggest/releases/tag/v2.1.2