Skip to content

Conversation

@tbl0605
Copy link
Contributor

@tbl0605 tbl0605 commented Sep 15, 2023

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.

tbl0605 added a commit to tbl0605/vue-simple-suggest that referenced this pull request Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant