Akryum / vue-mention

Mention component for Vue.js
https://vue-mention.netlify.app/
MIT License
523 stars 54 forks source link

Removing all character after `keys` do not reset the state of the items #69

Open drocha87 opened 2 years ago

drocha87 commented 2 years ago

I don't know if this is the expected behavior, but when I type @ to search for users for example and start typing everything works as expected, but if I remove everything until @ it let one character in the search string so we can't go back to the initial state where all users are available.

The problem happens in the demo in the official website demo

Animation

drocha87 commented 2 years ago

Seems like this if(value) is blocking the emit when removing all characters from searchText. Reference

watch(searchText, (value, oldValue) => {
  if (value) {
    emit('search', value, oldValue)
  }
})

Removing this if solved the issue to me.

devmaslove commented 7 months ago

Same problem