darrenjennings / vue-autosuggest

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

Emit itemChanged on empty item #177

Closed jkostolansky closed 4 years ago

jkostolansky commented 4 years ago

I'm trying to process the value selected using keyboard arrows. In the latest beta version, the plugin is emitting the itemChanged event (line 430 below).

The problematic scenario is:

  1. Write something into the input field
  2. Press the down key and select the first suggested option
  3. Press the up key and revert the suggestion

Unfortunately, there is currently no event emitted in the third step. Shouldn't the component emit an empty itemChanged event?

The relevant code: https://github.com/darrenjennings/vue-autosuggest/blob/eddb82d22437a61df40689f87625047edea71aab/src/Autosuggest.vue#L425-L438

darrenjennings commented 4 years ago

@jkostolansky thanks for the issue, you discovered a hidden feature of the latest beta 😄

Might be time to make it stable/documented. I will add it, and make sure it's emitted even when it's empty. I will also change it to item-changed.

jkostolansky commented 4 years ago

Thank you very much @darrenjennings 👍 I'm looking forward to the final release 🙂