darrenjennings / vue-autosuggest

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

currentIndex not cleared when suggestions are modified #136

Closed darrenjennings closed 5 years ago

darrenjennings commented 5 years ago

Original reported by @nickbetsworth in #135

The issue I have is that the currentIndex is never reset to null following a selection. In my implementation I'm removing items as they're selected, and clearing the input field each time.

A user can repeatedly click on the input box, followed by a click outside of the input box, and this will repeatedly add elements until currentIndex is out of bounds because I've removed a sufficient number of items.

I would potentially expect the the currentIndex to reset if the suggestions are modified.

Related: https://github.com/darrenjennings/vue-autosuggest/issues/82