KazanExpress / vue-simple-suggest

Feature-rich autocomplete component for Vue.js
https://kazanexpress.github.io/vue-simple-suggest/
MIT License
461 stars 74 forks source link

"select" event can return a null item even when the nullableSelect property is set to false #589

Open tbl0605 opened 1 year ago

tbl0605 commented 1 year ago

Hi, Sometimes the "select" event doesn't return a non-null element when used this way:

<vue-simple-suggest
   @select="setValueFromSuggestion"
   ...

To reproduce the problem with a vue-simple-suggest component:

  1. write something in the input field
  2. hover the suggestions with the mouse (but don't select a suggestion)
  3. press enter (the focus must still be in the input field)
  4. the setValueFromSuggestion function will retrieve an null/undefined item

Fortunately, the fix is quite simple.

Thierry.