vue-simple-suggest
vue-simple-suggest copied to clipboard
vue-simple-suggest should not mutate the array provided to the "list" property
Hi, currently vue-simple-suggest mutates any array supplied to the "list" property when the "max-suggestions" property is used.
<vue-simple-suggest
:list="listOfSuggestions"
:max-suggestions="99"
...
/>
This breaks the One-Way Data Flow recommended by Vue and affects parent state by triggering any watcher on the listOfSuggestions list, etc...
The reason for this property mutation is that the library internally uses the splice() function on the provided list, instead of using the slice() function which returns an array copy.
Thierry.