vue-form-generator icon indicating copy to clipboard operation
vue-form-generator copied to clipboard

vueMultiselect: can't remove tags, duplicates them

Open maxcorbeau opened this issue 5 years ago • 2 comments

I am using the field vueMultiSelect, adding tags works well, however deleting tags fails (clicking on x icon):

  • nothing happens when trying to delete the first existing tag
  • if you add a tag and try to delete it, a input event is emitted which duplicates tags

For instance:

  • Starts with Vue.js
  • Click x on Vue.js ==> tag remains, (BROKEN)
  • Add Rails.js ==> Vue.js, Rails.js (OK)
  • Click x on Rails.js ==> Vue.js, Vue.js, Rails.js (BROKEN)

Here is a link to reproduce the problem

Q: Is this failing because I misconfigured vueMultiselect (eg some options I need to set to prevent this behaviour) or because this is a bug?

maxcorbeau avatar Feb 14 '20 13:02 maxcorbeau

Each object in your values array needs to be tracked via an id. See the ‘trackBy’ key in the docs.

DelfsEngineering avatar Feb 14 '20 13:02 DelfsEngineering

Yes indeed, big miss :(

maxcorbeau avatar Feb 14 '20 16:02 maxcorbeau